Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Trend average for 3 months

Hi all,   I want average of current 3 months, eg : Jan, Feb, March   And I want average of previous 3 months, eg : Dec, Jan, Feb   Can you suggest Dax measure for this   Please Help
  • amitchandak's avatar
    4 years ago

    Anonymous , A measure like this with help from date table

     

    Rolling 3 = calculate(AverageX(Values('Date'[MONTH Year]),CALCULATE(sum(Sales[Sales Amount]))),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),0) ,-3,MONTH))

     

    or

     

    Rolling 3 = calculate(AverageX(Values('Date'[MONTH Year]),CALCULATE(sum(Sales[Sales Amount]))),DATESINPERIOD('Date'[Date ],eomonth(today(),0) ,-3,MONTH))