Forum Discussion
Anonymous
4 years agoNot applicable
Extra closing parenthesis added to a DAX Switch statement
I need to do conditional formatting based on two fields instead of one. To do this, I created a switch statement that creates an integer state variable that (I hope) can be used in conditional forma...
AlexisOlson
Super User
4 years agoDoes it help if you use a variable?
12amState =
VAR Max0 = ( MAX ( [12am], 0 ) = 0 )
RETURN
SWITCH (
MAX ( [NoiseCategory], 0 ),
1, IF ( Max0, 1, 2 ),
2, IF ( Max0, 3, 4 ),
3, IF ( Max0, 5, 6 ),
IF ( Max0, 7, 8 )
)