Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dax Conditional formatting

Hi,

 

I've created a field parameter with a set of measures which returns % values. I'd need to get a colour format based on the selected measure. 

I'm trying to get a dynamic colour format using below DAX:

 

CCcolorFormat =
                SWITCH(
                        TRUE(),
                        SELECTEDMEASURE() >= 0.90, "#00FF00",
                        SELECTEDMEASURE() >= 0.85, "#FFA500",
                        SELECTEDMEASURE() < 0.85, "#FF0000")

I'm not sure where I'm going wrong but the visual doesn't change any colours when using this DAX on the visual. Any help on this would be really appreciated.

Regards,
Mahesh
  • Hi,

    I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file whether it suits your requirement.

     

     

4 Replies

  • Hi,

    I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file whether it suits your requirement.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jihwan_Kim ,

      I've tried to implement your solution, however, I still don't get the colour format on the KPI visual.

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super User

        Hi,

        Thank you for your feedback.

        Could you please share your pbix file's link? And then I can try to look into it to come up with a more accurate solution for your data model.

        Thank you.