Forum Discussion
Create a Slicer based on data from 3 columns
- Anonymous2 years ago
Hi Anonymous
When you select A and B, SUM('Selection Table'[Value]) returns 3 rather than 7 you'd expect, that's why it doesn't work here. You can modify the Result measure like below.
Result = SWITCH ( SUM ( 'Selection Table'[Value] ), 1, [Sum of TypeA], 2, [Sum of TypeB], 3, IF ( COUNTROWS ( 'Selection Table' ) = 1, [Sum of TypeC], [Total of TypeAB] ), 4, [Total of TypeAC], 5, [Total of TypeBC], 6, [Total of Types] )Or you can try a new measure
Result = SWITCH( VALUE(CONCATENATEX('Selection Table','Selection Table'[Value])), 1 , [Sum of TypeA], 2 , [Sum of TypeB], 3 , [Sum of TypeC], 12, [Total of TypeAB], 13, [Total of TypeAC], 23, [Total of TypeBC], 123, [Total of Types] )Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Anonymous , First Unpivot the Types columns and then pull the value and country on to table visual. Pull the Type column to Slicer.. In future if more types are added, then automatically slicer gets updated. Attached screenshots.
Hey, Thank you for the reply. This will not work for me since my actual dataset has DAX columns and measures.
Is there way to do this using Switch statement or maybe by other techniques using DAX? Please let me know, Thanks!