Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure Value for Previous Month

I have a measure that I want to pull the previous months value instead of the current value when I put it in a table. Is it possbile to do this and ignore all page date filters as well? Needed in a c...
  • Ashish_Mathur's avatar
    4 years ago

    Hi,

    You must have a Calendar Table with calculated columns for Year, Month name and Month number.  Sort the Month name by the Month number.  Create a relationship from the Date column of your Data Table to the Date column of the Calendar Table.  Create slicers from the year and Month name columns of the Calendar Table and select a year and Month name.  Write these measures

    Total = sum(Data[Amount])

    Previous month total = calculate([Total],previousmonth(Calendar[Date]))

    Hope this helps.