Forum Discussion
Jane123
9 years agoFrequent Visitor
Calculate previous month aggregate amount
Hi I have a table with the columns Date and Amount.Two filters are provided for the year and month based on the date. I need to calulate the sum(Amount) for the previous month based on the filte...
- 9 years ago
Hi Jane123,
I try to reproduce your scenario and get expected result as follows.
My sample data is shown in the picture below.
Create measure to calculate the total sum sales of previous month.Previous = CALCULATE(SUM(Table_Ex[Amount]),PREVIOUSMONTH(DateTable[Date]))
Create slicer including Year, Month field. Create a table displays the expected result. The "Amont" field shows the sum of sales in March, The "PreviousMonth" field shows the sum of sales in Feb.
Best Regards,
Angelia
RDDWH
7 years agoNew Member
This may be another alternative:
Measure = TOTALMTD('Table_Ex'[Amount],DATEADD('Table_Ex'[Date],-1,MONTH))