Forum Discussion

Jane123's avatar
Jane123
Frequent Visitor
9 years ago
Solved

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...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    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