Forum Discussion
LukeWalker
8 years agoAdvocate IV
Variable Value Changes Based on Return Expression Bug
I have the following measure: Y/Y Price Inflation =
VAR MaxDate = MIN(MAX('Calendar'[Date]),TODAY())
RETURN
CALCULATE(
VAR Num = [Cumulative Price Inflation]
VAR Denom = CALCULATE([...
v-chuncz-msft
8 years agoCommunity Support
LukeWalker
8 years agoAdvocate IV
That's super helpful. It looks like it's changing "Num" when it's combined with "Denom".
"RETURN Num" evaluates to X
"RETURN Num + Denom * 0" evaluates to a value different from X
I'm still clueless as to why, but now I kind of know what's going on at least.
Can variables be passed between measures? There are some variable names defined in this measure (Y/Y Price Inflation) that are also used in the dependent measure (Cumulative Price Inflation). However, changing the names doesn't fix the problem either..
I've also tried running the "Num" inside a CALCULATE(ALL('Calendar'),...) clause, but that doesn't fix it.
CALCULATE([Cumulative Price Inflation],FILTER(ALL('Calendar'),'Calendar'[Date]<TODAY()))
- CALCULATE([Cumulative Price Inflation],FILTER(ALL('Calendar'),'Calendar'[Date]<TODAY()- 365)) * 0
=
CALCULATE([Cumulative Price Inflation],FILTER(ALL('Calendar'),'Calendar'[Date]<TODAY())The above returns "TRUE". However when the two clauses are run independently, they do not equal each other.