Forum Discussion

goncalogeraldes's avatar
goncalogeraldes
Icon for Super User rankSuper User
5 years ago
Solved

Get two separate slicers for two separate measures

I have a flat file for the sales department with the product column. My goal is to have two slicers where the user can select only one product in each to perform a comparision in the total amount and the YoY amount. Previously, this was attained with two separate graphs (visuals) but the sales manager want me to aggregate it into only one visual to have the same X and Y axis and therefore be able to visually have the same proportion. The following image shows the current situation. 

 

 

The goal is to aggregate the two graphs into one and have, for example, Amount A and Amount YoY A and Amount B and Amount YoY B that vary depending on the select values. I've tried to find a solution in similar threads but none seems to fit my requirements. What would you suggest?

3 Replies

  • goncalogeraldes , for this year vs last year, you can use time intelligence

     

    This will do with single slicer


    YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
    Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
    This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
    Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

     

     

    Or refer my video if  you need two slicers

    How to use two Date/Period slicers :https://www.youtube.com/watch?v=WSeZr_-MiTg

     

    • goncalogeraldes's avatar
      goncalogeraldes
      Icon for Super User rankSuper User

      My main problem is not calculating the measures but rather the interactions between the two slicers and each separate measure. I know my explanation may be somewhat confusing...