Forum Discussion
When to use variables vs measures
- 1 year ago
Measures are dynamic, they recalculate for each different filter context. You may not always want that, so you materialize intermediate results into variables (which is actually a misnomer as for all intents and purposes these are constants, not variables) so the values are no longer impacted by subsequent measure calculations.
You can materialize intermediate steps into scalar or table variables but the final result of the measure always must be a scalar value.
Measures are dynamic, they recalculate for each different filter context. You may not always want that, so you materialize intermediate results into variables (which is actually a misnomer as for all intents and purposes these are constants, not variables) so the values are no longer impacted by subsequent measure calculations.
You can materialize intermediate steps into scalar or table variables but the final result of the measure always must be a scalar value.