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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Regular 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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.