Forum Discussion

jbryant's avatar
jbryant
Frequent Visitor
4 years ago
Solved

Custom Colors in a Stacked Column Chart not displaying correctly

Hi all, this is my first post here.  I've tried finding the answer to my question in the forums but have come up short so far. My question is pretty basic.  I've got a pbix that contains a couple ...
  • jbryant's avatar
    jbryant
    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.