Number.Round
NumberRounds a number to a specified number of digits.
Syntax
Number.Round(number as nullable number, optional digits as nullable number, optional roundingMode as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The number to round. |
digits | number | No | Number of decimal places (default 0). |
roundingMode | number | No | Rounding mode (RoundingMode.Up, .Down, .AwayFromZero, .ToEven). |
Return Value
number — The rounded number.
Remarks
Number.Round rounds a number to the specified number of fractional digits. When digits is omitted it defaults to 0 (round to the nearest integer). The optional roundingMode parameter controls tie-breaking behaviour — RoundingMode.ToEven (banker's rounding) is the default.
This is commonly used to clean up calculated columns such as averages, percentages, or unit conversions where excessive decimal places are not meaningful.
Examples
Example 1: Round salary in thousands to 1 decimal
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Employees, 4), {"FullName", "Salary"}),
"SalaryK", each Number.Round([Salary] / 1000, 1), type number
)Result
FullName | Salary | SalaryK | |
|---|---|---|---|
| 1 | alice smith | 55,000 | 55 |
| 2 | BOB JONES | 95,000 | 95 |
| 3 | Charlie Brown | 72,000 | 72 |
| 4 | diana PRINCE | 68,000 | 68 |
Example 2: Round product prices to nearest ten
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Products, 5), {"ProductName", "Price"}),
"RoundedPrice", each Number.Round([Price], -1), type number
)Result
ProductName | Price | RoundedPrice | |
|---|---|---|---|
| 1 | Widget A | 25 | 20 |
| 2 | Gadget B | 50 | 50 |
| 3 | Widget C | 15 | 20 |
| 4 | Gadget D | 75 | 80 |
| 5 | Thingamajig E | 120 | 120 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks