Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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 ?

 

marcing733_0-1648039319842.png

 

 

7 REPLIES 7
JT_MSUK
Advocate I
Advocate I

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.

v-zhangti
Community Support
Community 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. 

vzhangti_2-1648532189832.png

vzhangti_1-1648532106553.png

 

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
Not applicable

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

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

 

marcing733_1-1648192777661.png

 

marcing733_0-1648192758480.png

marcing733_2-1648192817092.png

marcing733_3-1648193064998.png

 

PijushRoy
Super User
Super User

Hi @Anonymous 

Please try this
0.JPG

 

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




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





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)

marcing733_0-1648040315277.png

 

Hi @Anonymous 

Please share data or pbix file (non confidential)




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.