Forum Discussion
Why ALL is not working ?
- 3 years ago
Hi jajaAtPowerbi
Please tryredeemed member count (same period LM) = VAR StartDateLM = [start date LM] VAR EndDateLM = [end date LM] RETURN CALCULATE ( [redeemed member count], FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] >= StartDateLM && 'Calendar'[Date] <= EndDateLM ) ) - 3 years ago
tamerj1 it works by creating a local variable inside measure redeemed member count (same period LM) but i do not understand the difference.
Would you mind explain why?
Thanks you so much.
tamerj1 it works by creating a local variable inside measure redeemed member count (same period LM) but i do not understand the difference.
Would you mind explain why?
Thanks you so much.
jajaAtPowerbi
Measures in a DAX formula impose context transition therefore, in the original formula there are evaluated in a filter context that is created by transforming the row context created by FILTER into a filter context by the measure reference. So each measure will be repeatedly re-evaluated for every iteration of the FILTER function.
However, variables are evaluated only once. If a measure is evaluated within the outer filter context and stored in a variable, the value of the variable will not be ultered (meaning the measure will not be re-evaluated) even if referenced inside an iterator, rather it will always keep the value of the very first evaluation.