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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
virakprom
Frequent Visitor

Conditional formatting negative numbers red

Anyone know how set Conditional formatting rule on negative numbers to red ? 
I want negative numbers or percentage to red.
I try to set minimum field to blank but it don't allow me to set it.

photo_2019-08-06_11-30-35.jpg

1 ACCEPTED SOLUTION

@jdbuchanan71  
Very appreciate for your effort to me.
Thank for your support.
Now this issue found already. 

This picture at below that I got email from Microsoft
Issue.PNG

View solution in original post

21 REPLIES 21
jhauff_RFO
Frequent Visitor

Conditional Format Matrix to Red/Black
Go to Visual Pane > Cell elements > Turn Font Color (or other option) to "On" > Click on the fx icon
Font Color.jpg

Choose Rules from the "Format style" dropdown (see screen shot below)
Choose "Values and totals" from the "Apply to" dropdown
Keep the "What field should we base this on?" dropdown as is.
Rules Value Options:
1) Choose greater than ">" from the 1st "If value" dropdown. 
Go to the next field.
2) Enter a very large negative number, e.g., -100000. Go to the next field.
3) Choose Number from the dropdown (see Note below).
4) Follow the screen shots below for the other Rules values.

Note:  There seems to be a glitch in how the “Apply to” dropdown and the “value dropdown” interact.
If the 3rd field of the Rules dropdown (1) does not show "Number" as a option, change the "Apply to" dropdown (2) to "Value only". 
"Number" should now appear as an option in the 3rd field of the Rules "If value" dropdown (1).
Change the 3rd "If value" dropdown (1) to Number, then go back and change the "Apply to" dropdown (2) to “Values and totals”.

Conditional Formatting1.jpg

 

Values.jpg

 

jitendrapandey
Advocate II
Advocate II

In Field formatting, use Red as default color for this column.  This would render all values (negative or positive) in Red color.

Then use Conditional formatting to color the positive values in Green.  The conditional formatting would look something like this: 

 

Format by Rules

Based on Field

<Your Numeric Column Name>

 

Rules

If value is greater than or equal to  0  Number and is less than or equal to <a very large number> Number then Green

 

Please mark it as accepted solution if works.

 

Thanks and regards,

Jitendra Pandey

virakprom
Frequent Visitor

Thank all of you contribute to help me solve this issue. but It still not working all your mention above. 
I think It's bug or error on this issue. I need to extra field in order to show red on negative values.
It doesn't make sense, right ? Why it need to add one more field in table in order to work ?
But my requirement don't need it
you can see picture at below

1.png2.PNG

Hi,

 

This is possible by using a gradient with custom values.

 

LukeDexters_0-1668616819977.png

 

Thanks! That resolved the issue! 🙂

@virakprom 

Can you show me a screen shot of your rule with greater than -1 (NEGATIVE 1) and NUMBER and less the 0 number.

negativeformat2.jpg

Try this for Positive and Negative numbers

 
Capture.PNGCapture1.PNG

@jdbuchanan71 
Very appreciate for your effort to me. but this solution isn't working. 


Reports.PNG

Thank you @virakprom 

Can you share your .pbix file?  I have no idea why that is not working.

Hello @virakprom 

I don't have access to your company's sharepoint.  You will have to load it to something like OneDrive or DropBox and give us that link.

@jdbuchanan71  
Very appreciate for your effort to me.
Thank for your support.
Now this issue found already. 

This picture at below that I got email from Microsoft
Issue.PNG

Hello @virakprom 

That is good to know, thank you for sharing.

jdbuchanan71
Super User
Super User

Hello @virakprom 

You can change the type from percent to number and put a negative amount in the first field.  The formatting below will format negative % from -100% to 0 as red.
negativeformaat.jpg

Anonymous
Not applicable

The best simply solution ever, thank you.

It isn't working. but I want show percentage not decimalUntitled.png

Hi @virakprom ,

 

Please set the your conditional formatting as per screen shot below and let me know your result:

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

It still not work. I try to follow like you mention at above.

Untitled.pngUser role administrator.PNG

@virakprom 

In your example -26 % is the same as -.26.  If you format the number with 

Greater than -1 NUMBER and is less than 0 NUMBER that is the same as saying -100% and 0%.

conditionalformatnegatives.jpg

When you use the % setting it is looking at the percentage of your data meaning, if you have 100 data points and pick Less than 50 percent it will format the first 50 data points.

 

Hi @virakprom ,

 

Is it possible for you to give me sample of just 5-10 rows of data file so that I can try it at my end?

Not want to real data just create similar data and send file here.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors