Forum Discussion
How to create a single slicer that can combine data from multiple columns?
- 1 year ago
Hi ksheth ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you FBergamaschi for the prompt response.
I have developed a PBIX file using the given sample data.Please go through the attached PBIX file for your reference.
- 1 year ago
I’ve had to do this before 🙂. The trick is to unpivot the fruit columns so they become rows:
In Power Query, select the columns Bananas, Apples, Pears, Grapes.
Right-click → Unpivot Columns.
You’ll now have a table like:
Person Fruit Value A Bananas Yes A Apples No A Pears Yes A Grapes YesLoad this back → use the new Fruit column in your slicer.
Add a visual/filter where Value = "Yes" so only the “Yes” responses count.
Now when you pick “Apples” in the slicer, Persons C, D, and E show up. Multi-select works too — if you pick Apples + Grapes, you’ll get everyone who said Yes to either of those fruits.
👉 Tip: If you can’t change the model in Power Query, you could do something similar with UNION in DAX to reshape the data into a long table. But Power Query unpivot is the cleanest.
Hi,
I think this is a modeling issue. Actually, the Fruit table is a fact table. Adding a new fruit-only table as a dimension table. All the slicers should be from dimensional tables ideally. Please refer to https://drive.google.com/file/d/16eHJZBWKk-ba07ggcB0_6PUYUgWHv3vD/view?usp=sharing , which is based on the file of v-venuppu .