Forum Discussion
joshua1990
6 years agoPost Prodigy
Conditional formatting for bar chart
Hello everyone! I have a simple bar chart with a line. the bar shows me the actual sales per day and the line shows me the budget. is there any chance to get a red bar if the sales were for the co...
joshua1990
6 years agoPost Prodigy
Thanks, for your reply!
Please, read my post carefully. I am not looking for conditional formatting in a table.
I am looking for changing the color of bars in a bar chart...
TomMartens
6 years agoSuper User
Hey joshua1990 ,
this measure returns the name of a color that should be applied to a bar if a certain condition is met:
fill Color =
IF(DIVIDE([Total Sales Amount (PY)] , [Total Sales Amount]) >= 1.2 , "red" , BLANK())
This article lists the colors that are supported: https://blog.crossjoin.co.uk/2018/08/10/colour-names-supported-in-power-bi-conditional-formatting/
It's also possible to provide the hexcode of color using e.g "#ba3811".
Here is a visual:
I applied the measure to the Default color of the Data colors well of the chart:
I selected this rule
Hopefully, this is what you are looking for.
Regards,
Tom