Forum Discussion
Anonymous
3 years agoNot applicable
Using Parameters as Slicer switch between measures
Hello All, I have a requirement to select a value and based on the selection the visual needs to switch between 2 measures Parameter options :- (Approved, Saved) needs to be a slicer I have 2 measu...
WBarberena
3 years agoFrequent Visitor
Greetings Anonymous,
I used a slicer in that same way, only I used the SWITCH function instead of if/then and it worked for me:
https://learn.microsoft.com/en-us/dax/switch-function-dax
I made the following measure then assigned the slicer.
Parameter_Select =
SUMX (
VALUES ( 'Sort_Parameters'[Parameter] ),
SWITCH (
'Sort_Parameters'[Parameter],
"Parameter1", [Measure1],
"Parameter2", [Measure2],
"Parameter3", [Measure3],
"Parameter4", [Measure4]
)
)
I had multiple measures that I needed to sort, so I put them in the 'Parameter_Select' table. You may or may not need to use SUMX.
Hope this helps.