Number.RoundAwayFromZero

Number

Rounds a number to the specified number of decimal places, always rounding away from zero on ties (the traditional "round half up" rule for positives).

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Number.RoundAwayFromZero(number as nullable number, optional digits as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
numbernumberYesThe number to round.
digitsnumberNoThe number of decimal places to round to. Defaults to 0 (nearest integer).

Return Value

numberThe number rounded away from zero to the specified decimal places.

Remarks

Number.RoundAwayFromZero implements "Round Half Away From Zero" — when a value falls exactly halfway between two representable values, it rounds to the value that is farther from zero. For positive numbers this means rounding up (2.5 → 3); for negative numbers this means rounding down toward more negative values (-2.5 → -3).

This is the conventional rounding taught in most schools and used in Excel's ROUND function. It is a useful alternative to Number.Round, which defaults to "Round Half to Even" (banker's rounding), where ties round to the nearest even number (2.5 → 2, 3.5 → 4). Banker's rounding is statistically unbiased over large datasets, but Number.RoundAwayFromZero matches common human expectations and matches Excel's behavior.

The optional digits parameter specifies how many decimal places to retain. When omitted, it rounds to the nearest integer. Negative values are not supported for digits.

When to use each: - Use Number.RoundAwayFromZero when matching Excel, matching user expectations, or when presenting rounded values to end users - Use Number.Round (banker's rounding) when statistically unbiased rounding is required for large financial datasets

Examples

Example 1: Positive half-value rounds up (away from zero)

Result
Result
13

Example 2: Negative half-value rounds down (away from zero, toward -∞)

Result
Result
1-3

Example 3: Round to 2 decimal places

Result
Result
11.56

Example 4: Compare banker's rounding vs. away-from-zero on half-values

#table(
    {"Value", "Number.Round (Banker's)", "RoundAwayFromZero"},
    {
        {0.5, Number.Round(0.5), Number.RoundAwayFromZero(0.5)},
        {1.5, Number.Round(1.5), Number.RoundAwayFromZero(1.5)},
        {2.5, Number.Round(2.5), Number.RoundAwayFromZero(2.5)},
        {3.5, Number.Round(3.5), Number.RoundAwayFromZero(3.5)}
    }
)
Result
Value
Number.Round (Banker's)
RoundAwayFromZero
10.5001
21.5022
32.5023
43.5044

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks