Number.Power
NumberRaises a number to a specified power.
Syntax
Number.Power(number as nullable number, power as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The base number. |
power | number | Yes | The exponent to raise the base to. |
Return Value
number — The result of raising number to the given power.
Remarks
Number.Power raises the first argument to the power of the second. For example, Number.Power(2, 3) returns 8. Fractional exponents are supported — Number.Power(x, 0.5) is equivalent to Number.Sqrt(x). Negative exponents return reciprocals.
This is useful for mathematical transformations such as squaring values for variance calculations or applying exponential scaling.
Examples
Example 1: Square each product price
Table.AddColumn(
Table.SelectColumns(Products, {"ProductName", "Price"}),
"PriceSquared", each Number.Power([Price], 2), type number
)Result
ProductName | Price | PriceSquared | |
|---|---|---|---|
| 1 | Widget A | 25 | 625 |
| 2 | Gadget B | 50 | 2,500 |
| 3 | Widget C | 15 | 225 |
| 4 | Gadget D | 75 | 5,625 |
| 5 | Thingamajig E | 120 | 14,400 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks