Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
andrea100
Helper I
Helper I

Create colouring on bar chart depending on conditions of a column and the count

Hi, I am looking for help to create colouring on a bar chart depending on certain conditions.
I have a bar chart which displays the column Performance. The values in this column are categories. The graph shows the grand total count (%) of each category. 

andrea100_0-1738081704291.png

I would like to do conditional formatting colouring on the bars with the following conditions:

Meets Expectations is colour orange when, Meets Expectations + Exceeds Expectations > 90

Marginal is coloured yellow when, Marginal + Below Expectations > 40

Exceeds is coloured green when, Exceed Expectations > 30

Below is coloured red when, Below Expectations> 15

 

Since I am doing a grand total count of each category, I have tried to create measures for each performance category to count the grand total, but realized this does not work as it will not take the other measures into account. This is what I did: 

I created this conditional formatting measure

 

 

Conditional Formatting Measure = 
Switch(TRUE(),
SELECTEDVALUE('Aggregate'[PerformanceLevel]) = "Meets " && [Meets%]+[Exceeds%] > 90, "orange",
SELECTEDVALUE('Aggregate'[PerformanceLevel]) = "Marginal" && [Marginal%] + [Below%] > 40, "yellow", 
SELECTEDVALUE('Aggregate'[PerformanceLevel]) = "Exceeds" && [Exceeds%] > 30, "green", 
SELECTEDVALUE('Aggregate'[PerformanceLevel]) = "Below" && [Below%] > 15, "red",  "grey")

 

 

Where [Exceeds%], [Meets%], [Marginal%], [Below%] are measures I created to try to capture the grand total % count. 

The calculations I used for each were similar:

 

 

Exceeds% = [Count ExceedExpectations]/
COUNTROWS(FILTER(ALLSELECTED('A Table'),'A Table'[PerformanceLevel] IN {"Below Expectations","Marginal","Meets Expectations","Exceed Expectations" }))*100

 

 

After doing this and testing, I realized by doing the separate measures for each performance category, it was not taking the other categories into account. When I tried to sum them in the conditional formatting measure, one of them would be counted as 0. Perhaps I am overcomplicating and there is a much simple way to do this.

This is a link to sample workbook: google drive 

How can I do this? I would appreciate any guidance and help. Thank you

 

4 REPLIES 4
lbendlin
Super User
Super User

Link asks for access. please check.

Sorry about that, updated my post

google drive 

That file is a tad too big. Please provide sample data that covers your issue or question completely, Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.


I've edited the file and made it as small as possible. 
My expected outcome is to colour the bar chart with the following conditions -

Meets Expectations is coloured orange when, Meets Expectations + Exceeds Expectations > 90

Marginal is coloured yellow when, Marginal + Below Expectations > 40

Exceeds is coloured green when, Exceed Expectations > 30

Below is coloured red when, Below Expectations> 15

Thank you for looking into this.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.