The same CALCULATE three times in one measure: slower to run, impossible to review

Updated 2026-11-27 · 3 min read

Symptom

A growth measure nobody dares to touch, and a page that takes seconds to refresh.

Cause

Each repeated expression can be evaluated again.

Fix

Name each step once with VAR and return the result.

The problem

A growth measure repeats the same CALCULATE three times. It is hard to read, and the engine may evaluate the same expression several times.

The fix

Name each step with VAR; the final expression follows RETURN. A variable is evaluated once, in the context where it is defined.

Revenue growth % =
VAR Current  = [Revenue]
VAR Previous = CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
RETURN
    IF ( NOT ISBLANK ( Previous ), DIVIDE ( Current - Previous, Previous ) )

Debug trick

Temporarily write RETURN Previous to check one step in a card, then put the real expression back.

Keep learning

Generate a Power BI report for free