Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Bar chart - conditional Y Axis Label color based on value/measure

I have simple table called Data, what I need is to have Y Axis on bar chart colored: red if measure called Result is 0, Green if measure Result is 1.
Result = SUM(Data[Budget]) - SUM(Data[Cost]).
It works fine in table viz, but in Bar Chart all Y Axis Labels have the same color based on Result TOTAL value (Total Row from Table). Could you please tell me how to fix this ?

 

 

 

7 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    The Y-axis calculation only returns the final value of Total equal to 1 and the color Red, which cannot be displayed separately. 

     

    Unfortunately, this is by design. Power BI is now unable to achieve what you need . You can submit an idea for it at https://ideas.powerbi.com/forums and wait for users with the same needs as you to vote for you to help make it happen as soon as possible.

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you v-zhangti . That is such a inconvenience, I posted idea, hope this will be developed soon.

  • PijushRoy's avatar
    PijushRoy
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    Please try this

     

    If solve your requirement, please mark this answer as SOLUTION
    If this comment helps you, please LIKE this comment/Kudos

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi PijushRoy 
      I already tried that, that's why every label is green in my bar chart and this is wrong - only Product A should be Green, B and C red (same as in table)

       

      • PijushRoy's avatar
        PijushRoy
        Icon for Community Champion rankCommunity Champion

        Hi Anonymous 

        Please share data or pbix file (non confidential)

  • Anonymous's avatar
    Anonymous
    Not applicable

    hi PijushRoy ,

    unfortunately I cannot share PBIX.

    It is very simple file with one table with data and measure Reasult.

    in table viz conditional formatting works good, every row in Product is treated differently and color is set there individually. The problem is with Bar chart, it is setting colors for all Y axis labes based on a Result total value for whole table (if we will change cost for Product A to be higher as budget, then Result value for whole table will be 0 and all labels in Bar chart Y axis will be red - I already tested that). Maybe it is a bug? It looks like ther is no filter context for Result measure in Bar chart.... Screenshots below

     

     

     

  • Apologies for necroing the thread, but has there been any updates on this in the last 18 months? I'm in the same boat. Have a simple measure if more than 0, show green, if less, show red, if same show black.

     

    Using another card it will return the correct values as I click each part of the graph, but the Y axis on a bar chart just shows the overrall text colour so it's all in red. Seems like an astonishingly simple oversight in PowerBi.