Forum Discussion

Kurt4597's avatar
Kurt4597
Icon for Helper I rankHelper I
3 years ago
Solved

YoY on a graph

I am trying to create a year on graph from the following tables

 

Table 1: DateDim


Table 2: Sales



I will have the date on the datedim filter set as follows

 

and the graph would look like this

 

 

I am struggling on a way to do this. I could create a YoY measure but then plotting it on a graph is what I am stuck with. Any help would be much appreciated! Thank you all

 

Sample File - https://easyupload.io/lacpf5

 

  • Your previous year measure would be something like this

    PY Sales = CALCULATE(SUM(Sales[Count]),DATEADD(Dim_date[Date],-1,year))

3 Replies

  • Syk's avatar
    Syk
    Icon for Resident Rockstar rankResident Rockstar

    You can create this with measures or you can use the month and days as the axis (without year) and use year as the legend.

     

    • Kurt4597's avatar
      Kurt4597
      Icon for Helper I rankHelper I

      The issue I have with this method is that because the date filter only shows May 01/05/2023 - 21/05/2023 then it will filter out the line from previous year. Because of this, I think it is best to use a measure. Could you please assist?

  • Syk's avatar
    Syk
    Icon for Resident Rockstar rankResident Rockstar

    Your previous year measure would be something like this

    PY Sales = CALCULATE(SUM(Sales[Count]),DATEADD(Dim_date[Date],-1,year))