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
achand
Regular Visitor

Stacked bar chart default color for a single category

I've generated a stacked column chart to display the count of Boolean values for YES and NO. However, since the data field lacks information for NO, I'm only seeing the count for YES. Despite this, I'm unable to change the color of the bar. Assistance in resolving this issue would be greatly appreciated.

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @achand ,

 

You can make a No row exist in your fact table but appending a row or you can create a separate Yes/No dimensions table and relate to fact. You then use this dimension column in your bar so you'll have the option to format the bar for No. Please refer to the attached pbix for details.

danextian_1-1713422801937.png

 

danextian_0-1713422774233.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Hi @achand ,

 

You can make a No row exist in your fact table but appending a row or you can create a separate Yes/No dimensions table and relate to fact. You then use this dimension column in your bar so you'll have the option to format the bar for No. Please refer to the attached pbix for details.

danextian_1-1713422801937.png

 

danextian_0-1713422774233.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I've attached a snippet below to provide clarity on the matter. Below there's a stacked bar chart with a Legend added on the second chart, while the first one lacks it. Interestingly, I can modify the color of the bars on chart without Legend, but I'm encountering difficulty in changing the color on the chart with Legend.

achand_0-1713424381313.pngachand_1-1713424421954.png

 

 

The option to change the color of a legend should be in Bars tile under Formatting pane.

danextian_0-1713427603684.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Yes I know, but when there's no data available for the NO category, attempting to change the color for the YES category is restricted. Despite the restriction on changing the color for the YES category when there's no data available for the NO category, I found a workaround. I created a separate table with values for the NO category, appended it to the main table, and this successfully resolved the issue. However, if there's an alternative solution available, I would greatly appreciate it.

Thank you so much!

I did mention appending an extra row in my initial reply. Also using a separate dimenions table would have also worked. In the pbix I attached, No doesnt exist in fact but in the dimensions table so you can still format the No in the dimensions table as it exists there. You'll just have to use the column from that table instead and enable show items with no data before formatting the legend.

danextian_0-1713430275314.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.