Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
Checks a condition, and returns one value when TRUE
, otherwise it returns a second value. It uses an eager execution plan which always executes the branch expressions regardless of the condition expression.
IF.EAGER(<logical_test>, <value_if_true>[, <value_if_false>])
Term | Definition |
---|---|
logical_test |
Any value or expression that can be evaluated to TRUE or FALSE . |
value_if_true |
The value that's returned if the logical test is TRUE . |
value_if_false |
(Optional) The value that's returned if the logical test is FALSE . If omitted, BLANK is returned. |
Either value_if_true
, value_if_false
, or BLANK
.
The IF.EAGER function can return a variant data type if value_if_true and value_if_false are of different data types, but the function attempts to return a single data type if both value_if_true
and value_if_false
are of numeric data types. In the latter case, the IF.EAGER function will implicitly convert data types to accommodate both values.
For example, the formula IF.EAGER(<condition>, TRUE(), 0)
returns TRUE
or 0, but the formula IF.EAGER(<condition>, 1.0, 0)
returns only decimal values even though value_if_false
is of the whole number data type. To learn more about implicit data type conversion, see Data types.
IF.EAGER has the same functional behavior as the IF function, but performance may differ due to differences in execution plans. IF.EAGER(<logical_test>, <value_if_true>, <value_if_false>)
has the same execution plan as the following DAX expression:
VAR _value_if_true = <value_if_true>
VAR _value_if_false = <value_if_false>
RETURN
IF (<logical_test>, _value_if_true, _value_if_false)
Note: The two branch expressions are evaluated regardless of the condition expression.
See IF Examples.
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!