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
SrikanthBI
Regular Visitor

Conditional formatting - Change of chart color based on the value of the measure

Hi,

 

Being a new comer to Power BI, struggling to understand all the features provided currently. Is there a feature for conditional formatting for the bar chart shows different colors based on a target value (If less , shows different color and if more , another color)

 

I have tried color saturation feature and it doesnt give me exactly what i m looking for? Can any one advise?

 

Kind Regards.

 

1 ACCEPTED SOLUTION

If you just want your bar to be colored green if you value is above 100 and otherwise red then this is very possible with Color saturation.

 

Put the same measure as you have in your Value into the Color saturation.

Then go to the format tab and under Data colors set minimum and maximum to 100 and change the colors to red and green.

 

That should do it.

 

ColorSaturation.png

/sdjensen

View solution in original post

13 REPLIES 13
Brian_M
Responsive Resident
Responsive Resident

Hi SrikanthBI, I completely agree and have been looking for this feature. Custom viz development is beyond me at the moment, so I've suggest this idea here:

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13757925-dynamically-specify-data...

 

If you think that would do what you are after, please support the idea!

sdjensen
Solution Sage
Solution Sage

Color saturation should be able to do what you ask for. Could you elaborate what is not working with color saturation?

 

 

/sdjensen

Hi,

 

I have a requirement to show the bar color chart (individual bar) to show green if it is above certain value

For eg: if total value is >100, bar should show green , or red otherwise.

 

Can you pls advise if this is possible to address this as a workaround via Color formatting as I have tried basic options and didnt give me what I m looking for?

 

Pls advise.

 

Thanks, Srikanth

If you just want your bar to be colored green if you value is above 100 and otherwise red then this is very possible with Color saturation.

 

Put the same measure as you have in your Value into the Color saturation.

Then go to the format tab and under Data colors set minimum and maximum to 100 and change the colors to red and green.

 

That should do it.

 

ColorSaturation.png

/sdjensen
Anonymous
Not applicable

This soultion may work for BAR, but not with other charts like CARD etc..

 

Any alternative approach?

 

Thanks,

How can we chnage color based on a measure in a gauge chart.

 

For example the target is 99.5%

 

if it is clsoe to targte it shows greeen else red

Is there I can change color based on a measure value which changes based on the filters selected.

 

For e,g.

 

I have a filter Gold, Others

 

If it is filtered  on Gold the measure has a value 98%

 

It is filtered on Others it has a value 87%

 

The Gold has a target of 99%

The others has a target of 85%

 

If the Measure is filtered on gold it should be red as it has not reached it's target.

 

If the Measure is filterd on others it should be green as it has reached the target of others.

Others have  a target of 86%

 

 

@premjitsaha

Currently there is no way to format the column based on a variable/measure value. Conditional formatting will only work for a hard coded value (Min/Max value).

Anonymous
Not applicable

Is this still the case? or has Power BI come up with any updates in the recent releases? I am not able to find anything online!

Thanks, This is now solved

You can write a custom bar chart to handle your color logic. You can start with the histogram chart in the custom visuals repository. Then modify "fill" logic to display colors based on values.

 

https://github.com/Microsoft/PowerBI-visuals/blob/master/src/Clients/CustomVisuals/visuals/histogram...

 

For example, I change the bar color to red. See attachment.Screen Shot 2016-06-15 at 9.57.01 AM.png

the link does not work

Greg_Deckler
Super User
Super User

They just added conditional formatting for tables, but I am not aware of that feature for column chart visualizations. You might consider adding a Reference Line in the formatting options, perhaps that is a different visual cue to sort of get what you want?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.