Forum Discussion
Rajendrabobade
5 years agoHelper II
Last 3 month Average
Hello , I need last 3 month average dax , based on current month . there is no selction for month . eg: for now there is november is current month . Thank you .
- 5 years ago
If you have a date table, you can use this measure:
_Last3M = VAR _today = EOMONTH(TODAY(), 0) VAR _tbl = DATESINPERIOD('Calendar'[Date], _today, -3, MONTH) RETURN CALCULATE(AVERAGE('Table'[Sales]), _tbl)
manikumar34
5 years agoSolution Sage
Try something like this
6 Months Average Measure =
CALCULATE(
SUM('Sales data'[Revenue]),
DATESINPERIOD('Sales data'[weekstart],LASTDATE('Sales data'[weekstart]),-3,MONTH)
)
/
CALCULATE(
DISTINCTCOUNT('Sales data'[weekstart]),
DATESINPERIOD('Sales data'[weekstart],LASTDATE('Sales data'[weekstart]),-3,MONTH)
)
Regards,
Manikumar