Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Chilladin
Regular Visitor

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.

 

Chilladin_0-1727696404591.png

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:

Chilladin_1-1727696905266.png

 

 

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

 

1 ACCEPTED SOLUTION

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:

vlinhuizhmsft_1-1728354206839.png

 

2.Click on Font color:

vlinhuizhmsft_2-1728354283605.png

 

3.Format Style Select the second option - Rules:

vlinhuizhmsft_3-1728354349238.png

 

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

vlinhuizhmsft_4-1728354459826.png

 

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

vlinhuizhmsft_5-1728354625275.png

vlinhuizhmsft_6-1728354711307.png

 

 

Best Regards,
Zhu
Community Support Team

 

View solution in original post

8 REPLIES 8
v-linhuizh-msft
Community Support
Community Support

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")

vlinhuizhmsft_0-1727755181355.png

The result is as follows:

vlinhuizhmsft_1-1727755225290.png

 

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.

 

 

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:

Chilladin_2-1727774682664.png

The code/string: 

Chilladin_3-1727774718606.png

 

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

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.

vlinhuizhmsft_1-1727775537265.png

vlinhuizhmsft_2-1727775586616.png

 

 

Best Regards,
Zhu
Community Support Team

 

You don't need to apologize I am just new to PowerBI, so it's pretty confusing navigating around the many different aspects of it. I'm just thankful for you helping and leading me to the answer 🙂

 

If I do a conditional formatting I get a different rule so it add a < or >, instead of = that you showed me on your first reply.:

Chilladin_0-1727776784091.png

I can refer to my latest reply to amitchandak if you want to see how I tried to do it after his instructions.

 

So is it correct to assume:

I don't need to create a new measure, but can just use conditional formating on my percentage field?

or

Do I need to combine the measure and my percentage field?

 

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:

vlinhuizhmsft_1-1728354206839.png

 

2.Click on Font color:

vlinhuizhmsft_2-1728354283605.png

 

3.Format Style Select the second option - Rules:

vlinhuizhmsft_3-1728354349238.png

 

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

vlinhuizhmsft_4-1728354459826.png

 

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

vlinhuizhmsft_5-1728354625275.png

vlinhuizhmsft_6-1728354711307.png

 

 

Best Regards,
Zhu
Community Support Team

 

Thank you so much for your help Zhu! 

It worked and sorry for the late reply and "accept as solution" I had other tasks that suddenly got a higher priority than this one, but could finally return to it today :).

 

Have a great day and thank you again for your patience and instructions!

amitchandak
Super User
Super User

@Chilladin , Change Percent to number and 100 to 1 (Percent  is for distribution) Percent  measure is a number between 0 and 1 (or more)

 

Move negative first .

 

Refer: https://youtube.com/shorts/UaQX0yOeAWE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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:

Chilladin_1-1727773943642.png

 

- 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.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.