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
joshua1990
Post Prodigy
Post 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 corresponding day below the line/ budget? 

Best Regards

3 REPLIES 3

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...

 

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:

TomMartens_0-1593270169401.png

I applied the measure to the Default color of the Data colors well of the chart:

TomMartens_1-1593270284116.png

I selected this rule

TomMartens_3-1593270355833.png

Hopefully, this is what you are looking for.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.