Forum Discussion

mfarali's avatar
mfarali
Frequent Visitor
3 years ago

% difference between years for average sales

Hi,

 

I have a situation where I have sales data from across the years. I would like to show on average what is the % change from one year to the other based on slicer selection. Something like the table low. 

 

I would like to show the % difference between lets say 2018 to 2021 in a line graph based on slicer selection. I have tried to use DAX measures but I cant seem to get it work.

 

Can anyone please help me on this?

 

 

Thanks in advance

 

9 Replies

  • what will you put on the x-axis of the line graph?

    can i say 2018 is the minimum and 2021 is the maximum of the slicer selection?

    • mfarali's avatar
      mfarali
      Frequent Visitor

      The years will be on the x axis. so depending on selection, it could be 2018 to 2021, or 2019 to 2021 etc

      • FreemanZ's avatar
        FreemanZ
        Super User

        the difference is 2018 vs 2021 or 2018 vs 2019, 2019 vs 2020, 2020 vs 2021?

  • mfarali's avatar
    mfarali
    Frequent Visitor

    not really, the difference could be any year vs any year (as chosen in the slicer)

     

    So the viewer could select 2019 and 2021. or 2018 and 2019. or any other combo that they want to see the % difference for.

    • FreemanZ's avatar
      FreemanZ
      Super User

      so in any selection, the difference is a single value, why being plotted with year on the x axis?

      • mfarali's avatar
        mfarali
        Frequent Visitor

        the difference is a single value if only 2 years are selected. but if the viewer wants to see the trend then they can select more than 2 years to see the changes in %

         

        like choosing to see 2018, 2019, 2020 if they wanted to