Forum Discussion

blackbool44's avatar
blackbool44
Icon for Helper I rankHelper I
6 years ago
Solved

2 levels Selector : TONS/Turnover - Current/YTD

Hello Dear Power BI Community,

 

I have a request concerning SWITCH selectors,

 

I have my data following this pattern,

 

Sales

DateTonnageTurnover
01/01/20191244
03/05/20191448
08/09/20193354
01/01/20202131
02/05/20205144
09/11/20202278

 

And I have a calendar table (Calendar)

 

In order to create my first selector

 

I have created a Switch Table (Selector Curr/YTD) :

SelectorSelectorNB
Current1
YTD2

 

 

I have created the following measures :

 

 

selector Nb = MIN(Selector Curr/YTD[SelectorNB])

 

 

 

 

 

Tonnage Curr = sum(Sales[Tonnage])

 

 

 

 

 

Tons YTD = CALCULATE(SUM(Sales[Tonnage]), DATESYTD('Calendar'[Calendar.Date]))

 

 

 

This works perfect and I can generate a selector on my dashboard

 

However, I would like the user to be able to switch first between tons and Turnover on a first selector

then to switch between current and YTD on a second selector.

Do you know if this is possible ?
How would you approach the issue ?

is there any tutorial out there that could help me achieve this ?

Thanks a lot for your great help !

  • parry2k's avatar
    parry2k
    6 years ago

    blackbool44 unpivot your table

     

    - transform data
    - select date column 
    - right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement
    - close and apply

    you can use Attribute column for slicer and rest everything will work

     

    I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

     

     

     

5 Replies