Forum Discussion

Chilladin's avatar
Chilladin
Frequent Visitor
1 year ago
Solved

Help with conditional formating and negative + positive percentages

Hello,

 

I want to use the conditional formating option to make all the negative values green and the positive values red.

 

So all the values with a - infront it green and the only one positive value 1,03% red (and also the future ones). 

I've tried this:

 

 

but all it does it make all my data green and the red one doesn't work.

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Chilladin ,

     

    Below are the complete steps for setting up the conditional formatting, you can follow each step to end up with the desired results:

     

    1.Click on the drop-down arrow:

     

    2.Click on Font color:

     

    3.Format Style Select the second option - Rules:

     

    4.Setting up the fields that our rules need to be based on is the measure that we created earlier:

     

    5.Set up two rules by clicking on New rule, and finally click OK to get the final result:

     

     

    Best Regards,
    Zhu
    Community Support Team

     

8 Replies

    • Chilladin's avatar
      Chilladin
      Frequent Visitor

      Hello Amitchandak,

      Thank you for the reply. It helped me understand the percentages, but when I add in the things you mentioned it still doens't color the table:

       

      - I changed the percentages to "tal" which is numbers

      - I changed the 100 to 1's 

      Which resulted in no colors this time.

       

      I don't know if I did something that deviated from your instructions.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the helpful reply from amitchandak.

     

    Hi Chilladin ,

     

    You can also create a measure and use it to set the conditional formating, for example:

    Measure = IF(MAX('Table'[Column1])<=0,"RED","GREEN")

    The result is as follows:

     

    Best Regards,
    Zhu
    Community Support Team

     

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

     

     

    • Chilladin's avatar
      Chilladin
      Frequent Visitor

      Hello Zhu,

       

      Thank you for the reply.

      This got me the furthest out of the many YouTube tutorials, ChatGPT Prompts and messing around myself in PowerBI.


      I'm pretty close to what I want, but instead of the numbers that you've got there I've only gotten the "Red" + "Greens" do I need to somehow combine the measure and my table?

       

      Table:

      The code/string: 

       

      And I sure will press "Accept as Solution" when I've found something that works. Thanks for the reminder 🙂

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Chilladin ,

         

        I'm sorry I didn't explain it clearly, what we need is conditional formatting for the percentage field, not for the measure created, also the measure is written with “GREEN” and “RED” just to differentiate, you can use any number or text instead. Depending on your picture, just change it to a conditional formatting of the preceding fields.

         

         

        Best Regards,
        Zhu
        Community Support Team