cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SrikanthBI Frequent Visitor
Frequent 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

Accepted Solutions
sdjensen Senior Member
Senior Member

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

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
13 REPLIES 13
Super User
Super User

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

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?


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


sdjensen Senior Member
Senior Member

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

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

 

 

/sdjensen
SrikanthBI Frequent Visitor
Frequent Visitor

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

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

dnprock Frequent Visitor
Frequent Visitor

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

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

Brian_M
Advisor

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

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 Senior Member
Senior Member

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

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

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

Thanks, This is now solved

premjitsaha Frequent Visitor
Frequent Visitor

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

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

Highlighted
premjitsaha Frequent Visitor
Frequent Visitor

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

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%