Forum Discussion
Anonymous
2 years agoNot applicable
dax
I have Month number as [Month], sales as Retailing , document_date and i want to display sales of last to last month. and another measure of sales prior to last to last month. These needs to be displ...
Anonymous
2 years agoNot applicable
Hi Anonymous
first of all , You have to create calendar table and then connect with your table. That calendar table(Table name is calendar) structure below.
after you will create dax measure.
DAX 1:
LAST 1 MONTH = CALCULATE(SUM(Orders[Sales]),DATEADD('calendar'[Date],-1,MONTH))
DAX 2:
LAST 2 MONTH = CALCULATE(SUM(Orders[Sales]),DATEADD('calendar'[Date],-2,MONTH))
DAX 3:
LAST 3 MONTH = CALCULATE(SUM(Orders[Sales]),DATEADD('calendar'[Date],-3,MONTH))