Forum Discussion
LucMarv
4 years agoHelper I
Run a block of code within a SWITCH()
Hi, All the examples of a switch include a very simple structure... For example: = SWITCH([Month], 1, "January", 2, "February", 3, "March", 4, "April" , 5, "May", 6, "June", 7, "July", 8, "Augus...
- 4 years ago
Try writing them as two seperate measures then using the measures in the switch.
Measure_Name = VAR _Seletcion = SELECTEDVALUE ( grouping[group] ) RETURN SWITCH ( TRUE (), _Selection = "all", [All Measure], _Selection <> "all", [Other Measure] ) - 4 years ago
Yeah, this solution works and I have implemented this. I am not a big fan of it though, because I dont really like creating so many measures. I have a relatively simple app, and have created over 100 measures already...
It works, but its not neat.
Thanks for the guidance!
jdbuchanan71
4 years agoSuper User
Try writing them as two seperate measures then using the measures in the switch.
Measure_Name =
VAR _Seletcion =
SELECTEDVALUE ( grouping[group] )
RETURN
SWITCH (
TRUE (),
_Selection = "all", [All Measure],
_Selection <> "all", [Other Measure]
)
LucMarv
4 years agoHelper I
Yeah, this solution works and I have implemented this. I am not a big fan of it though, because I dont really like creating so many measures. I have a relatively simple app, and have created over 100 measures already...
It works, but its not neat.
Thanks for the guidance!