Forum Discussion
lauren2021
5 years agoFrequent Visitor
Slicer to Select Column without Unpivoting Table
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 loo...
- 5 years ago
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.
amitchandak
5 years agoSuper User
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/