Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE. Uses eager execution plan.
Any value or expression that can be evaluated to TRUE or FALSE.
The value that is returned if the logical test is TRUE.
The value that is returned if the logical test is FALSE; if omitted, BLANK is returned.
Either ResultIfTrue or ResultIfFalse expression result, depending on LogicalTest.
Calling IF.EAGER enforce eager evaluation of the conditional expression, instead of relying on choice between strict and eager evaluation made by the DAX engine.
The IF.EAGER was visible in the metadata only in the verified builds shown aside. It has been later removed from visible functions, even though it is still included in the engine. This function should be used only in very particular case of DAX optimization, after verifying that it produces a clear performance advantage compared to the regular IF function.
» 3 related functions
-- The engine can use either STRICT or EAGER evaluation. -- The choice is up to the optimizer. -- Using IF.EAGER you can force eager evaluation of IF statements. -- Useful in some optimization scenarios. DEFINE MEASURE Sales[GrossAmount] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Price] ) MEASURE Sales[NetAmount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] ) EVALUATE ADDCOLUMNS ( VALUES ( 'Product'[Brand] ), "Sales", IF ( 'Product'[Brand] = "Contoso", [GrossAmount], [NetAmount] * 1.5 ) ) ORDER BY 'Product'[Brand]
|The Phone Company||1,685,728.60|
|Wide World Importers||2,852,934.98|
Learn more about IF.EAGER in the following articles:
Other related functions are:
Contributors: Alberto Ferrari, Marco Russo