Forum Discussion
Slicer to Select Column without Unpivoting Table
- 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.
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
- lauren20215 years agoFrequent Visitor
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!
- v-xulin-mstf5 years ago
Community Support
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.