Page 40 - DAX-Formula-Reference-Guide-Enterprise-DNA_Neat
P. 40
DAX Formulas Reference Guide | Logical Functions (DAX)
IF FUNCTION (DAX)
Checks if a condition provided as the first argument is met. Returns one value if the
condition is TRUE and returns another value if the condition is FALSE.
Syntax: IF(logical_test>,<value_if_true>,value_if_false)
Parameter Definition
logical_test Any value or expression that can be evaluated to TRUE or FALSE.
value_if_true The value that is returned if the logical test is TRUE. If omitted, TRUE is
returned.
value_if_false The value that is returned if the logical test is FALSE. If omitted, FALSE is
returned.
Return Value:
Any type of value that can be returned by an expression.
=IF([Calls]<200,”low”,IF([Calls]<300,”medium”,”high”))
IFERROR Function (DAX)
Evaluates an expression and returns a specified value if the expression returns an error;
otherwise returns the value of the express itself.
Syntax: IFERROR(value,value_if_error)
Parameter Definition
value Any value or expression.
value_if_error Any value or expression.
Return Value:
A scalar of the same type as value.
Example:
=IFERROR(25/0,9999)
SWITCH Function (DAX)
Evaluates an expression against a list of values and returns one of multiple possible
result expressions.
Syntax: SWITCH(<expression>,<value>,<result>[,<value>,<result>]…[,<else>])
+64 21 164 5508 | info@enterprisedna.co 40

