Reply
achand
Regular Visitor
Partially syndicated - Outbound

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

Syndicated - Outbound

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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

Syndicated - Outbound

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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.

Syndicated - Outbound

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

 

 

Syndicated - Outbound

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

danextian_0-1713427603684.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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.

Syndicated - Outbound

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!

Syndicated - Outbound

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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.
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)