Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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
Link asks for access. please check.
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.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
9 | |
6 |