Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
blackbool44
Helper I
Helper I

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 !

1 ACCEPTED SOLUTION

@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!

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@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!

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Dear @parry2k ,


Thanks a lot, I have followed your instructions and unpivoted my table to get the turnover and the tonnage on the same column.
I created a slicer for the type of value (tonnage or turnover).
And then created a disconnected table with my second slicer categories (current/YTD).
Which I activate thanks to a SWITCH dax formula.

For those who want to know more about the switch formula for filtering tables : I followed this great tutorial from Avi Singh : https://www.youtube.com/watch?v=Tn0P_1RLZaI

 

Have a great day  !

Hi @amitchandak ,

it works for a 1 level slicer (Curr/YTD).
Howeve, I need to ann another Level (Tons/turnover).

The user first choose 1 level : Tons or Turnover
Then choose the second level : Curr or YTD

 

Thanks a lot

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.