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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
abdulrafey
New Member

Need help with stacked bar chart visual

s1.png

I am new to power bi and facing difficulty in splitting the colors on the same bar in stacked bar chart. I have reached to this and cannot split colors on bar. Please help me with this.

s2.png 

1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @abdulrafey ,
Based on your description, you want to color split the bars by type. There are two prerequisites to accomplish this step, first for your sub-Category you need to have more than one under the same Category, as this is the category that is used as a measure of the length of the bar chart. Secondly you need to use stuck bar chart for this.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1713332100431.png

Final output

vheqmsft_1-1713332174010.png

Best regards,

Albert He

 

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

 

 

View solution in original post

5 REPLIES 5
v-heq-msft
Community Support
Community Support

Hi @abdulrafey ,
Based on your description, you want to color split the bars by type. There are two prerequisites to accomplish this step, first for your sub-Category you need to have more than one under the same Category, as this is the category that is used as a measure of the length of the bar chart. Secondly you need to use stuck bar chart for this.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1713332100431.png

Final output

vheqmsft_1-1713332174010.png

Best regards,

Albert He

 

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

 

 

audreygerred
Super User
Super User

When you say you are having difficulty splitting the color on the same bar - are you wanting the sub-categories to appear in the same bar, but different colors or are you wanting something else?





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

Proud to be a Super User!





Kiven03
Frequent Visitor

hi @abdulrafey ,

 

Instead of adding Sub-category in legend, add it in the Y-asix below Category and check.
I hope this is what you are looking for, please feel free to ask if you any further query.

 

Thank You
Vivek

Sorry, it doesn't works. Please tell me the general way of doing it, do we have to write any query for data range. And what is DAX query and where it is written?

@abdulrafey 

No need of DAX its simple, with previous solution you need to click on drill down button, and then hold ctrl+ click on the specific bar.

Kiven03_0-1712687513338.png

 


You are not able to see the color splitting cause all the 6 cells of category and sub-category are different.


please check this video, to understand how to use bar chart. https://youtu.be/_LYN02Fi4Wo?si=A6QknXuY67k_FDNF

Thank you.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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