Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Computing Difference between latest MAT (Moving Annual Total) and MAT for previous 12 months

Hi Community, I'm in troubles and hope you can help me!

 

I'm trying to calculate de growth rate between MAT for the last 12 months for sales data and the MAT for the previous 12 months before the first ones. This not works because this calculation cannot find any data and is dividing by zero so the result is Infinite.

 

For example I need to see, the growth rate between MAT sales on Novembrer 2018 and November 2017, which is -37.63% (Sales_MAT-Sales_MAT-2)/Sales_MAT-2 but i'm in the situation as you can see in the screenshot.

 

 

MAT and MAT-2 Sales DAX formua are actually:

 

Sales_MAT = CALCULATE(SUM(Sales), DATESINPERIOD(Date_Table[Date], LASTDATE(Date_Table[Date]),-1,YEAR))
Sales_MAT-2 = CALCULATE(SUM(Sales), DATESINPERIOD(Date_Table[Date], DATEADD(LASTDATE(Date_Table[Date]),-1,YEAR),-2,YEAR))

 

I need to place data for Nov17 next to Nov18 to accomplish this? Could you help me?

 

Thanks!

4 Replies