Forum Discussion

MxJ's avatar
MxJ
Frequent Visitor
7 years ago

Rolling year based on index

Hi All,

 

I am trying to create a rolling year (sum of retail of last 12 months) based on index (NOT on date, I don't have dates like in the example!) for each location seperate but haven't quite got what I want. Right now I am using 2 querries but the second one is giving an error. 

 

First one calculates the starting month of the rolling year, so the max index (this month) - 12 months

Rolling Year Index = MAX('Retail'[Index])-12

The second one should SUM the retail figures if the index of the row is larger than the outcome of the measure above.

Rolling Year = CALCULATE(sum('Retail'[Retail Value]);'Retail'[Index]>[Rolling Year Index])
But I get a error that a true/false expression is used with calculate.
 
I have added some of the data I use. So location A should SUM index 3-14, B also index 3-14 and C index 5-16
 
Any tips? 
 
Thanks in advance! 

2 Replies