Number.Abs

Number

Returns the absolute value of a number.

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

Syntax

Number.Abs(number as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
numbernumberYesThe number whose absolute value is returned.

Return Value

numberThe 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
1alice smith55,00015,000
2BOB JONES95,00025,000
3Charlie Brown72,0002,000
4diana PRINCE68,0002,000

Compatibility

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