DAX SWITCH multiple conditions

Viewed 61
Color no Stock = SWITCH(
     TRUE()
     ,[Bestand] < 0 && [Bestand] > -[ZUS], "#f44242"
     ,[Bestand] < -[ZUS], "#8800ff"
 )

Hi,

i want to use the switch function, to display the numbers in the matrix in a certain font color.

  • If number < 0 -> number should be red.
  • Else If number < - ZUS (in this example 1500) -> number should be purple.

enter image description here

Unfortanely everything below 0 is purple

1 Answers

Not reproducible. With

Color no Stock = SWITCH(
     TRUE(),
     SUM('Table'[Amount]) < 0 && SUM('Table'[Amount]) > -1500, "#f44242",
     SUM('Table'[Amount]) < - 1500, "#8800ff"
 )

I get:

enter image description here

Works like expected.

Related