Number.Sqrt
NumberReturns the square root of a number.
Syntax
Number.Sqrt(number as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The number to compute the square root of. |
Return Value
number — The square root of the number.
Remarks
Number.Sqrt returns the square root of a non-negative number. If the input is negative, an error is raised. This function is often combined with Number.Round to produce cleaner results.
Common use cases include distance calculations, standard deviation formulas, and normalising values by their magnitude.
Examples
Example 1: Square root of product prices
Table.AddColumn(
Table.SelectColumns(Products, {"ProductName", "Price"}),
"SqrtPrice", each Number.Round(Number.Sqrt([Price]), 2), type number
)Result
ProductName | Price | SqrtPrice | |
|---|---|---|---|
| 1 | Widget A | 25 | 5 |
| 2 | Gadget B | 50 | 7.07 |
| 3 | Widget C | 15 | 3.87 |
| 4 | Gadget D | 75 | 8.66 |
| 5 | Thingamajig E | 120 | 10.95 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks