Numeric Functions

Absolute value. This function returns the absolute value of a number.
Syntax: abs(numeric_expr)
Example: abs(Actual Dollars)
In this example, if Actual Dollars is -5, this calculation returns 5.

This function returns the value from the parent dimension. This is typically the value in totals row.
Syntax: parent(expression)
Example: parent(Total[Revenue])
In this example, the Annual Revenue column was created using the Totals value from the parent dive.
If the dive window is the result of a focus or find action, this function returns the Total of the parent dimension (even though the dive window displays a subtotal instead of the total).

Percent variance. This function computes the difference between two numbers as a percentage. The formula is ( (a-b) / abs (b) * 100). If b=0, the calculation returns null.
Syntax: pct_var(a,b)
Examples: pct_var(Total[Revenue],Total[Cost])
pct_var(2,1) returns 100
pct_var(3,4) returns -25
pct_var(1,0) returns null

This function can be used to perform functions on numeric data as if it is string data.
Syntax: string(x)
Example: string(Total[Units])

Truncate. Returns the expression as an integer. Positive numbers are rounded down and negative numbers are rounded up.
Syntax: trunc(expr)
Example: trunc(Cost)
In this example, if Cost=5.25, this calculation returns 5.