Forum Discussion

POWER_MI's avatar
POWER_MI
Post Patron
5 years ago
Solved

Switch condition adding color on rows

Hi,     I have question  for same condition and table  Column = SWITCH ( TRUE (), 'Table'[Step] IN { 1, 2, 3 } && 'Table'[COLOR] IN { "R", "G", "O" }, "R1", 'Table'[Step] IN { 1, 2, 3 } && 'Table...
  • v-yingjl's avatar
    v-yingjl
    5 years ago

    Hi POWER_MI ,

    Since you are using measures to calculate, I still think you need to create each color format for each measure:

    Color_R1 = 
    VAR _step =
        SELECTEDVALUE ( Feuil1[STEP] )
    RETURN
        SWITCH (
            TRUE (),
             ( _step = 1
                || _step = 2
                || _step = 3 ), "green",
            _step = 5, "orange"
        )
    Color_R2 = 
    VAR _step =
        SELECTEDVALUE ( Feuil1[STEP] )
    RETURN
        SWITCH ( TRUE (), _step = 1, "green", _step = 4, "orange" )
    Color_R3 = 
    VAR _step =
        SELECTEDVALUE ( Feuil1[STEP] )
    RETURN
        SWITCH ( TRUE (), _step = 2, "green", _step = 4, "orange", _step = 7, "red" )

     

    Attached the file in the below, hopes to help you.

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.