Forum Discussion
Custom Colors in a Stacked Column Chart not displaying correctly
- 4 years ago
Additional information:
After changing the changing the Color Rule to use a number rather than a percentage, the column colors display properly.
I'm not sure if this is a bug or if I'm not understanding the Rule properly.Applying this rule (using Number), the graph displays as expected:
Applying this rule (using Percentage), the graph does not display as expected (colums with values > 65% show red:
I also came across a little tidbit, hidden away in the documentation:
Conditional table formatting in Power BI Desktop - Power BI | Microsoft Docs
The key takeaway from this document lies in this statement:Color by rules for percentages
If the field the formatting is based on contains percentages, write the numbers in the rules as decimals, which are the actual values; for example, ".25" instead of "25". Also, select Number instead of Percent for the number format. For example, "If value is greater than or equal to 0 Number and is less than .25 Number" returns values less than 25%.
And finally, I found another response from MS on this:The way the "Percent" conditional formatting works is different than one might think, it doesn't have anything to do with percent of total. It take the lowest and highest displayed amounts and uses those to determine the formatting bands based on the Percent you entered so your table is looking at these numbers to apply the formatting.
So, the answer appears to be that in order to have the colors displayed as a % of the displayed values, one needs to use the Rule for Number rather than Percentage. All in all, somewhat confusing in the designer as to what the two options represent.
Hi, jbryant
Could you please consider sharing a simple sample file and I will test if I can reproduce your issue on my machine in order to find the cause of the issue?
Best Regards,
Community Support Team _ Zeon Zheng
- jbryant4 years agoFrequent Visitor
I've put together a sample and am happy to share it, but I don't see an option to upload a pbix or zip to this site.
I can share it with you if you'd like, just PM me with an email address, or point me in the right direction as to how to best share it.- AlexisOlson4 years agoSuper User
People typically share files here by linking to a copy stored in the cloud using DropBox, Google Docs, OneDrive, or similar.
- jbryant4 years agoFrequent Visitor
Additional information:
After changing the changing the Color Rule to use a number rather than a percentage, the column colors display properly.
I'm not sure if this is a bug or if I'm not understanding the Rule properly.Applying this rule (using Number), the graph displays as expected:
Applying this rule (using Percentage), the graph does not display as expected (colums with values > 65% show red:
I also came across a little tidbit, hidden away in the documentation:
Conditional table formatting in Power BI Desktop - Power BI | Microsoft Docs
The key takeaway from this document lies in this statement:Color by rules for percentages
If the field the formatting is based on contains percentages, write the numbers in the rules as decimals, which are the actual values; for example, ".25" instead of "25". Also, select Number instead of Percent for the number format. For example, "If value is greater than or equal to 0 Number and is less than .25 Number" returns values less than 25%.
And finally, I found another response from MS on this:The way the "Percent" conditional formatting works is different than one might think, it doesn't have anything to do with percent of total. It take the lowest and highest displayed amounts and uses those to determine the formatting bands based on the Percent you entered so your table is looking at these numbers to apply the formatting.
So, the answer appears to be that in order to have the colors displayed as a % of the displayed values, one needs to use the Rule for Number rather than Percentage. All in all, somewhat confusing in the designer as to what the two options represent.