Forum Discussion
Anonymous
3 years agoNot applicable
Previous month problem
I want previous month data, but when i use dax like dateadd to go to previous month then it shows data of dec in front of jan. i want to show blank. how to achieve this.
amitchandak
Super User
3 years agoAnonymous , means do you want previous month with in a year ?
use offset
Previous Month in Year = CALCULATE([Net],OFFSET(-1, ALL('Date'[Month Year sort],'Date'[Month Year],'Date'[Year],'Date'[Qtr Year]),ORDERBY('Date'[Month Year sort]),KEEP,PARTITIONBY('Date'[Year])))
https://medium.com/microsoft-power-bi/power-bi-offset-function-84177cc2cafd
The information you have provided is not making the problem clear to me. Can you please explain with an example.
Appreciate your Kudos.