Forum Discussion

cyborgandy's avatar
cyborgandy
Helper II
2 years ago

Previous Year All Month Data Display

Hi All,

 

In the below snapshot the above graph is only showing  data for Jan and Feb of previous year, however I want this to show month on month trend of previous year and not only for selected period in calendar period.

 

The below graph is of the current year trend

 

Current DAX i am using to show the previous year data is :

External Previous Year = CALCULATE([External Total Count],DATEADD('Calender Date'[Date],-1,YEAR))

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi cyborgandy ,

    The function you used in the DAX formula does move the date by one year, but to make sure it captures the entire range of months in the previous year, we need to make sure that the context in which it is evaluated includes all the months in that year. Here's an improved method:

    External Previous Year = 
    CALCULATE(
        [External Total Count],
        FILTER(
            ALL('Calendar Date'),
            YEAR('Calendar Date'[Date]) = YEAR(MAX('Calendar Date'[Date])) - 1
        )
    )

    Best Regards,

    Xianda Tang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • cyborgandy's avatar
      cyborgandy
      Helper II

      Hi thanks you for your response, but this DAX is giving me the cumlative number of entire year in all the months however I want momnth on month count to be diplayed for last year and not the cumlative