Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

KPI colour - Conditional Formatting

Hello,

 

I have built a few KPI cards as follows ..

So.. It has a value coming out of a Measure (Can be percentage or value in Millions) and Goals coming out of a table containing all the targets based on months.

 

Now I want to change the colour of the Value coming from the Measure based on the Goals.

I want it to turn green even when it approaches the goal ..

say if the Goal is 50% and my value is 41% ..it should be green

if its 31% its orange and below 30% its red.

 

How can I achieve this?

 

May be this is simple.. but I am new to PBI and would love your responses.. 

 

 

  • Hi Anonymous 

    You can Either select the Card and go to 

    Or create a DAX measure for the purpose

     

     

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello,

     

    Thanks..

    But How can I use this to set up the rules for all three colours?

    I tried to set up the same rules for all the three (good, neutral and bad colour)..

    Isnt this the same as acking it up with DAX?

     

    Thanks

6 Replies

  • aj1973's avatar
    aj1973
    Community Champion

    Hi Anonymous 

    You can Either select the Card and go to 

    Or create a DAX measure for the purpose

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello..

       

      I saw this option is available individually for Good colour, neutral colour and bad colour...

      How can I set this up for KPI card?

  • Anonymous 

    Create a measure that gives you the color based on the conditions as follows:

    CF Goal = 
    SWITCH(
        TRUE(),
        [Actual] >= .41 , "Green",
        [Actual] >= .31 , "Orange",
        "Red"
    )


    Select your KPI Visual then click each fx under Color Coding

    Click on the  Format By and choose Field Value and under Based on, select your the Measure CF Goal

    Repeat for all three colors.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      Thanks..

      But How can I use this to set up the rules for all three colours?

      I tried to set up the same rules for all the three (good, neutral and bad colour)..

      Isnt this the same as acking it up with DAX?

       

      Thanks

      • Fowmy's avatar
        Fowmy
        Super User

        Anonymous 
        The conditions are set up in the measure CF Goal. You need to select Format by field value and select the CF goal for BAsed on Field. Refer to my 3rd screenshot