There's more...

To demonstrate the efficiency of using VAR statements, perform the following steps:

  1. Create the following measures:
Sum 6 =
IF(
SUMX('R11_Table','R11_Table'[Value]) = 0,
0,
SUMX('R11_Table','R11_Table'[Value])
)

Sum 7 =
VAR __Sum = SUMX('R11_Table','R11_Table'[Value])
RETURN
IF(__Sum = 0,
0,
SUMX('R11_Table','R11_Table'[Value])
)
  1. Create a Card visualization and place the Sum 6 measure in the Fields area of the visualization.
  2. Create a second Card visualization and place the Sum 7 measure in the Fields area of the visualization.
  3. Analyze the Card visualizations for Sum 6 and Sum 7 using Performance Analyzer.

You should see that Sum 7 consistently takes a shorter amount of time to complete than Sum 6. This is because Sum 6 performs the SUMX calculation twice, while Sum 7 only performs the SUMX calculation once.