cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SoraiaT
Helper I
Helper I

Conditional Formatting of Bar Chart

Hi,

 

Does anyonw knows how to add conditional formating to bar chart? There are no options on the Format-> Colour or at the collum like on tables.

 

Thanks!

Soraia

16 REPLIES 16
TarasUtkin
New Member

In the Visualizations - Bar - Color select fx button to define a function for conditional formatting.

 

TarasUtkin_0-1668027426488.png

 

Hi, I'll give it try! Thank you.

BA_Pete
Super User
Super User

Hi @SoraiaT ,

 

Apologies for the necro, but I was trying to solve the same problem and came across this thread.

 

I solved this by moving the chart dimension from Legend into Axis. It appears that you can't conditionally format (nor sort sometimes) charts that use a legend.

 

I've attached examples of the difference in visual display just by moving the dimension. The chart using Axis is conditionally formatted based on rules.

 

Hope this helps you and/or anyone else that may stumble across this thread looking for answers.

 

Pete

 


chart_with_axis.JPGchart_with_legend.JPG



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




v-yuezhe-msft
Microsoft
Microsoft

@SoraiaT,

Under Format ->Data colors of the bar chart , you can see "Advanced controls", open it and you will see conditional formatting windows.
Capture.PNG

Reference:
https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-november-2018-feature-summary/

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

My question is that this won't work on a stacked bar chart.
Your solution only works for single values in the column fields. How to format the colors individually on these?

Hi @v-yuezhe-msft Lidia,

 

I have the latest verson. Download again and that option keeps not showing:format not view.PNG

 

Do you have any idea why?

 

Thanks  again 🙂

 

 

Exactly, Even I have the same question

Hi @AnshulG ,

 

This is a very old thread and the capabilities of Power BI have moved on dramatically since this was posted.

If you're having trouble getting PBI to conditionally format how you want it to, I would strongly recommend you open a new topic in the Desktop forum and someone there will be able to help you very quickly.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




@SoraiaT,

When you directly drag two fields to Values section of the column chart, please manually change color for each field.
1.PNG0.PNG

If you drag field to Axis and Values to column chart as below, you will have the advanced control option.

2.PNG3.PNG



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yuezhe-msft, The data are in a single row. what I want to see is the value on the column "A" and the value on the column "B". If the value on "B" is higher and lower than "A" i would like to see different colours. Is there a way to do this? Thanks!

@SoraiaT,

As my previous post, if you drag two columns, it is only possible to manually set the colors for each column. If you want to set colors for each column based on the condition as you describe, you can use table visual and configure conditional formatting.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yuezhe-msft, Thank you. I want one of the columns to change colour based a condition. I've followed your steps but to see both values in the graph, the colour doesn't change. Can you download the example I've created with this link: https://we.tl/t-krmDnXIPB0 Should I do something different? Thx again, Soraia

@SoraiaT,

In your second chart, please click Advanced controls to configure conditional formatting as below.

0.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yuezhe-msft, The second chart has conditional formating but only shows one value, I would like to have the other value in the chart as well! Thx, Soraia

@SoraiaT,

When you put all the values into chart which like the first chart, it is not possible to use Advanced controls option, you would need to manually set color for them.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
itsmebvamsi
Responsive Resident
Responsive Resident

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.