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
DavidWaters100
Post Patron
Post Patron

Pir to switch or toggle between Type and Sub-type

Hi,

 

I am trying to getr a pie chart to switch or toggle.  When a user selects one "Type" in a slicer, the pie should show "Sub-type".  When they select "ALL", the pie should show "Type".  The reason for this toggle is because there are too many sub-types when "ALL" is selected.  Below link to a dummy re-creation - my method to do this was a distinct count of type.  So when "All" is selected the count is >1, but it does not work!

 

Any ideas how to do this please, or where I went wrong in file below?

 

thanks

 

https://www.dropbox.com/s/rzn35c28jqufiv1/pie%20toggle%20example.pbix?dl=0

Proud to be a Super User!
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@DavidWaters100 you should use bookmarks to achieve this

 

https://www.youtube.com/watch?v=_Afcj8mT5_Q

 

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
v-lili6-msft
Community Support
Community Support

hi  @DavidWaters100 

"Type" and "Sub-type" are different dim fields, Slicer is just used to filter data, it could not switch between different dim field in a visual.

 

So as a workaround, you could unpivot "Type" and "Sub-type"column into one column, then use that column in a visual and use attribute column as a slicer to switch it.

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your comments and replies.  In the end I decided to duplicate my sheet and add a button to navigate to that duplicated sheet where "All" was pre-selected and the "Type" pie was showing.  I added another button to return to the other sheet where user can choose a Type but not "All" - in this sheet the pie for "Sub-Type" is showing.  Bit of a workaround but user just clicks on an "All" button or goes back to choose different Types, and the pie appears to switch like that.

Proud to be a Super User!
negi007
Community Champion
Community Champion

@DavidWaters100you can achieve the desired result by using unpivot feature in power query window. In this way, you will have 3 columns one column which has numeric value, second column which will have main or sub-filter value, and 3rd column which will have all filter values. Below is the screenshot for your reference. 

 

Selection.png




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@DavidWaters100 , refer if this can help

Dynamically change chart axis in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0M

parry2k
Super User
Super User

@DavidWaters100 you should use bookmarks to achieve this

 

https://www.youtube.com/watch?v=_Afcj8mT5_Q

 

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.

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.