Forum Discussion
Calculate Rows of a Measure
- 6 years ago
Dalla_Terra , This because of row context and recalculation of measure grand total. The context of Grand total is also year and input is last year, that is why you see only last year
So one way out is that ytd/this year you use
sum(Depletion[Total 9L])
or try this
new YTDTY = Sumx(Values(Dates[Year]),[YTDTY])
- 6 years ago
Thanks to you both, your feedback put me on the right path to come up with the modifications I needed to make to make my calc work.
Previously my measures were:
- YTDTY = TOTALYTD(sum(Depletion[Total 9L]),Dates[Date])
YTDLY = TOTALYTD(Sum(Depletion[Total 9L]),SAMEPERIODLASTYEAR(Dates[Date]))
YTD Var = [YTDTY]-[YTDLY]
I modified my YTDTY and YTDLY as follows:
- YTDTY = Sumx(Values(Dates[Year]),TOTALYTD(Sum(Depletion[Total 9L]),Dates[Date]))
- YTDLY = Sumx(Values(Dates[Year]),TOTALYTD(Sum(Depletion[Total 9L]),SAMEPERIODLASTYEAR(Dates[Date])))
Leaving my YTD Var the same gave me what I was expecting to see
Dalla_Terra , This because of row context and recalculation of measure grand total. The context of Grand total is also year and input is last year, that is why you see only last year
So one way out is that ytd/this year you use
sum(Depletion[Total 9L])
or try this
new YTDTY = Sumx(Values(Dates[Year]),[YTDTY])