Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

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.

2 Replies

  • Anonymous , 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.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, amit i am attaching a screenshot of a table in which i have created  previous month sales (PM sales) and in the table when i want that sales in front of each month then in front of jan by default it shows sales of dec. Is it possible through dax or any other way that it shows blank in front of jan.