Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I am looking for a way to create a slicer that will allow a user to select which column to filter by, without unpivoting the table. For example, I have a table called 'Inventory' that looks somewhat like this:
I then have a donut chart that displays % and counts for my inventory (i.e. Inventory by Color shows 2 Red(10%ish), 4 Yellow, 5 Blue). However, I would like the user to be able to select which 'slice' of inventory they're looking at. So the slicer would have Color, Shape, and Price as single-select options. When they select Color, they see inventory counts broken out by Color, Shape by Shape, etc. Is this possible without unpivoting the table?
For context, I have other charts that show how much inventory is bought based on Color, Shape, Price and want to be able to compare with current inventory, but don't want to clog up the page by adding 3 more charts. So for example if we saw that Blue had the most purchases by Color, we can see that Blue makes up the most of the inventory so that adds up.
Thanks for any help!
Solved! Go to Solution.
Hi @lauren2021,
Try measure as:
Measure =
SWITCH(
SELECTEDVALUE('dim table'[subcategory]),
"Red", CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Color]="Red")),
"Yellow",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Color]="Yellow")),
"Blue",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Color]="Blue")),
"Square",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Shape]="Square")),
"Circle",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Shape]="Circle")),
"1",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Price]=1)),
"2",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Price]=2)),BLANK())Here is the demo: Slicer to Select Column without Unpivoting Table
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lauren2021
I agree with @amitchandak, you can use bookmark to meet your need.
Here is the output:
Here is the demo, please try it: Slicer to Select Column without Unpivoting Table
Best Regards,
Link
Hi!
This is very similar to what I am looking for, but I was mostly wondering if there was a way to select which column the visual was using for the legend? I've attached a mockup of what it would look like to help explain it better:
So right now the user would have 'color' selected so it would be showing the breakdown by color. Then if they selected "Shape," they would see the breakdown by shape.
Do you know if this is possible? (without unpivoting the table)
Thanks!
Hi @lauren2021,
Try measure as:
Measure =
SWITCH(
SELECTEDVALUE('dim table'[subcategory]),
"Red", CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Color]="Red")),
"Yellow",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Color]="Yellow")),
"Blue",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Color]="Blue")),
"Square",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Shape]="Square")),
"Circle",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Shape]="Circle")),
"1",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Price]=1)),
"2",CALCULATE(COUNT('Table'[Item Name]),FILTER(ALL('Table'),'Table'[Price]=2)),BLANK())Here is the demo: Slicer to Select Column without Unpivoting Table
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@lauren2021 , Based on what I got. Bookmark is another option if you do want to unpivot
https://radacad.com/clear-all-slicers-in-power-bi-a-bookmark-story
In case you are on the direct query.
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |