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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Conditional Formatting for Negative Numbers Bar Chart

I have a set of Revenue and EBITDA numbers for Customers. EBITDA can be negative sometimes. How can I still show it as positive but with a different color (red) than a positive EBITDA (black)? I was able to show it as positive value by using Absolute function but not sure how to run conditional formatting to make it look red? A3 is the customer with negative data. Here is:

  1. the data set on the right, 
  2. As is bar-chart in the middle
  3. Modified bar chart on the left with negative values shown as positive (only A3 here). But would like to make it red in color.2018-04-30_17-11-32.png
6 REPLIES 6
Meena_Jain
New Member

Hi, I saw this question today (I know its too late, but hoping it might help someone)

 

I created 3 measures to solve this

MEAS TOT PROFIT = SUM(Data[Profit])
MEAS PROFIT ABS = IF([MEAS TOT PROFIT]<0, ABS([MEAS TOT PROFIT]), [MEAS TOT PROFIT])
MEAS COLOR = ( IF(SUM(Data[Profit])<0, "RED","GREEN"))
 
Then created a Bar chart with MEAS PROFIT ABS in X asis and then, under Format Visual, Bars, Colors, Default color, I clicked on fx (conditional formatting) and there I selected that MEAS COLOR. 
 
Meena_Jain_1-1693382904840.png

 

I am sure there might be a more simpler way to solve this. But for now, this is what I could do in 2 mins. Hope it helps.

 

 

Perkele
Regular Visitor

You can do it if you go into Visualizations->Format->Data Colors. 

Then if you hover a mouse in the top-right corner you'll see 3 dots. If you click on those, you'll see a CONDITIONAL FORMATTING tab. There you can select different colors for negative and positive bars.

 

Perkele_0-1598627019028.png

 

mike250
Frequent Visitor

Liking the OP in support of wishing for this functionality.

v-yuta-msft
Community Support
Community Support

Hi Sang,

 

For more details about conditional formatting, please refer to:

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

This won't work for two reasons:

1. I want it on the bar-chart as explained. I do not see conditional formatting option in a bar-chart.

2. I want a different color for the bar-chart if another measure is negative.

 

Hi Sang,

 

Based on my test, in clustered column chart  you can change color of all values in a column, but I'm afraid changing part of values can't be achieved. You can submit your idea here:https://ideas.powerbi.com.

1.PNG  

 

In addition, although in this thread (posted in 2016):https://community.powerbi.com/t5/Developer/Conditional-formatting-Change-of-chart-color-based-on-the..., color saturation can meet your requirement, in recent PBI version this feature seems to be deprecated.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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