Forum Discussion

Louis66's avatar
Louis66
Icon for Resolver I rankResolver I
3 years ago
Solved

Problem with SWITCH to change colors

Hello,

 

I try to change the color using a measure, but without much success. Basically, my condition does not work :

 

 

Normally, the "Sugar" should show in Red... but everything shows in Orange.

 

Can someone help me ?

 

Regards,

 

Louis

  • Hi Louis66 ,

     

    This issue has been submitted internally.

    Internal ICM ID: 343098936 

    Please be patient to wait for fixing. If there is any news, I will update it here.

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 Replies

  • Jayee's avatar
    Jayee
    Icon for Responsive Resident rankResponsive Resident

    Hi Louis66 ,

     

    try below DAX Measure

    colour =
    SWITCH (
    SELECTEDVALUE ( 'Cookie Types'[Cookie Type] ),
    "Sugar", "Red",
    "Orange"
    )
    • lukiz84's avatar
      lukiz84
      Icon for Memorable Member rankMemorable Member

      ?! that's the same as the IF statement.

    • Louis66's avatar
      Louis66
      Icon for Resolver I rankResolver I

      Hello,

       

      Unfortunately this DAX Measure does not work either - please see this screenshot :

       

      Louis

  • lukiz84's avatar
    lukiz84
    Icon for Memorable Member rankMemorable Member

    Just for testing purposes, can you add your Colour measure to the matrix next to Cookie Type and see if it returns Red/Orange?

  • Hi Louis66 ,

     

    This issue has been submitted internally.

    Internal ICM ID: 343098936 

    Please be patient to wait for fixing. If there is any news, I will update it here.

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.