Number.Abs
NumberReturns the absolute value of a number.
Syntax
Number.Abs(number as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The number whose absolute value is returned. |
Return Value
number — The absolute (non-negative) value of the number.
Remarks
Number.Abs returns the non-negative magnitude of a number. If the input is positive or zero it is returned unchanged; if negative, the sign is removed. This is useful when computing differences where direction does not matter — for example, finding how far each value deviates from an average.
Examples
Example 1: Absolute difference from a target salary
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Employees, 4), {"FullName", "Salary"}),
"GapFrom70K", each Number.Abs([Salary] - 70000), type number
)Result
FullName | Salary | GapFrom70K | |
|---|---|---|---|
| 1 | alice smith | 55,000 | 15,000 |
| 2 | BOB JONES | 95,000 | 25,000 |
| 3 | Charlie Brown | 72,000 | 2,000 |
| 4 | diana PRINCE | 68,000 | 2,000 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks