I have data in which a row haa number of week and the corresponding sales on this week. Now for each week i want to calculate the average sales of last 8 weeks using DAX formula.
1
votes
1 Answers
0
votes
a solution posted here makes use of DATESINPERIOD() and LASTDATE():
Moving_Average_3_Months = CALCULATE ( AVERAGEX ( 'Session', 'Session'[Sessions] ), DATESINPERIOD ( 'Session'[FullDate], LASTDATE ( 'Session'[FullDate] ), -3, MONTH ) )
I hope this helps