Number.RoundUp
NumberRounds a number up away from zero (ceiling).
Syntax
Number.RoundUp(number as nullable number, optional digits as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The number to round up. |
digits | number | No | Number of decimal places (default 0). |
Return Value
number — The number rounded up to the specified precision.
Remarks
Number.RoundUp always rounds away from zero, increasing the magnitude of the number. When digits is omitted it defaults to 0, producing the next integer up. This behaves like a ceiling function for positive numbers.
A common use case is estimating resource needs — for example, rounding up the number of shipping boxes required so you never under-allocate.
Examples
Example 1: Round up average price per unit to whole number
let
AvgPrice = List.Average(Table.Column(Sales, "UnitPrice")),
Rounded = Number.RoundUp(AvgPrice)
in
#table({"AvgUnitPrice", "RoundedUp"}, {{AvgPrice, Rounded}})Result
AvgUnitPrice | RoundedUp | |
|---|---|---|
| 1 | 46.88 | 47 |
Example 2: Round up quantities to the nearest five
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Sales, 4), {"Product", "Quantity"}),
"BatchQty", each Number.RoundUp([Quantity] / 5) * 5, type number
)Result
Product | Quantity | BatchQty | |
|---|---|---|---|
| 1 | Widget A | 4 | 5 |
| 2 | Gadget B | 2 | 5 |
| 3 | Widget C | 10 | 10 |
| 4 | Gadget D | 1 | 5 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks