Forum Discussion
Problems implementing conditional formatting on bar chart with grand total count measures
Hi, thank you for looking into this. I tried, but it gives me the output 0.00% when I use ALL
Hi andrea100 ,
Can you provide the sample PBIX file? We can understand and help you better.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- andrea1001 year ago
Helper I
Hi! I have uploaded my file to OneDrive, please find it here:
Please let me know if there are any issues accessing the file.
- Anonymous1 year agoNot applicable
Hi andrea100 ,
Please try the following DAX.Below% = [Count BelowAverage]/ COUNTROWS(FILTER(ALLSELECTED('A Table'),'A Table'[PerformanceLevel] IN {"Below Expectations","Marginal","Meets Expectations","Exceed Expectations" }))*100Then, use this measure to conditionally display the color of the column.
Color = SWITCH( TRUE(), [Below%]>15,"red", [Marginal%]+[Below%]>40,"yellow", [Meets%]>=60,"orange", [Exceeds%]>=8,"green" )Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- andrea1001 year ago
Helper I
Hello Dengliang, Anonymous
I wasn't sure whether to create a new post or not. I've been playing around with this, I noticed that in some cases the conditional formatting doesn't work as expected (cases where there is a sum). I noticed it will not take the sum into account.
I am using this:
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")I have an instance where Meets+Exceeds>90 but the bar doesn't change colour. Would you be able to help me with this too? link to sample workbook