Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Compare values by year in PowerBI Desktop

Hello,

 

I want to compare values from different periods (years). I want in Line Chart report to compare the values from different years month by month. The important columns are Date and Q-ty.

My data is:

 

 

I want to compare these last 3 years in Line Chart or any other which is suitable. The data in lines is just to show how it should looks it is not with real data.  I have also a DATE table, if it will be needed.

 

Thanks in advance!

 

 

  • Don't know if it is too simplistic, but if you parse the date as 2 added columns (one for year and one for month), then create a line chart with Month as the Axis, Year as the Legend and Quantity as the Value, doesn't that give the effect you are looking for? I didn't add a measure to smooth out the charts, just did the basics and got this:

     

  • SivaMani's avatar
    SivaMani
    9 years ago

    Hi Anonymous,

     

    I have created two measure based on what I understand from you,

    1. PYR - previous year Qty
    2. TWOYRBCK = Qty 2 years ago

    See the gif,

     

    I hope I made it clear.

     

    Regards,

    Siva

5 Replies

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

    Anonymous,

     

    Have you tried calculated columns?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes , I have tried columns with YEAR() and MONTH(), but I don't know how to compae values from different years on one chart.

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

        Hi Anonymous,

         

        I have created two measure based on what I understand from you,

        1. PYR - previous year Qty
        2. TWOYRBCK = Qty 2 years ago

        See the gif,

         

        I hope I made it clear.

         

        Regards,

        Siva