Forum Discussion
reendzz98
3 years agoHelper I
Display previous month
Hi there. I need help to display previous month based on the data that I have. Below is the months that I have: I get to display current month using measure max(Month). I tried to find measure...
v-yalanwu-msft
3 years agoCommunity Support
Hi, reendzz98 ;
First you can create a date column for the month, if you have one, you don't need to create another one, if not, create a new date column for the month: similar to the following:
Then could try to create a measure to calculate the previous month's value:
Previous = CALCULATE(SUM('Table'[value]),PREVIOUSMONTH('Table'[Date]),ALL('Table'))
Or
Previous2 = CALCULATE(SUM('Table'[value]),DATEADD('Table'[Date],-1,MONTH),ALL('Table'))
Or
Previous3 = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),EOMONTH([Date],0)=EOMONTH(MAX('Table'[Date]),-1)))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.