Forum Discussion
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
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.
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.
- AnonymousNot applicable
Thank you v-zhangti . That is such a inconvenience, I posted idea, hope this will be developed soon.
- PijushRoy
Community Champion
Hi Anonymous
Please try thisIf solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos - AnonymousNot 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
- JT_MSUK
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.