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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Athenafordata
New Member

Summarize 2 groups on a stacked bar chart

Is there a Power Bi feature that will summarize (add) 2 groups on a stacked bar chart that has a total of 4 groups (as pictured)? I do not want to use Quick measure as that feature adds a 5th group to my chart.  I need a sum of the percetanges in the 2 blue groups.Capture.PNG

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

Hi @Athenafordata ,

 

This is my test table:

vyadongfmsft_0-1667289596231.png

 

The chart visual:

vyadongfmsft_1-1667289797377.png

 

Please create a new column:

Column = SWITCH(
    TRUE(),
    'Table'[Type] = "C", CALCULATE(SUM('Table'[Value]),FILTER('Table', ('Table'[Type] = "C" || 'Table'[Type] = "D") && 'Table'[Item] = EARLIER('Table'[Item]))),
    'Table'[Type] = "D",BLANK(),
    'Table'[Value])

vyadongfmsft_2-1667289853738.png

 

I think this is the result you want:

vyadongfmsft_3-1667289873679.png

 

Best regards,

Yadong Fang

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

2 REPLIES 2
v-yadongf-msft
Community Support
Community Support

Hi @Athenafordata ,

 

This is my test table:

vyadongfmsft_0-1667289596231.png

 

The chart visual:

vyadongfmsft_1-1667289797377.png

 

Please create a new column:

Column = SWITCH(
    TRUE(),
    'Table'[Type] = "C", CALCULATE(SUM('Table'[Value]),FILTER('Table', ('Table'[Type] = "C" || 'Table'[Type] = "D") && 'Table'[Item] = EARLIER('Table'[Item]))),
    'Table'[Type] = "D",BLANK(),
    'Table'[Value])

vyadongfmsft_2-1667289853738.png

 

I think this is the result you want:

vyadongfmsft_3-1667289873679.png

 

Best regards,

Yadong Fang

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

GregMarbais
Kudo Collector
Kudo Collector

@Athenafordata , I may be off in what I think you're trying to do but I think you can just create a grouping of the values. If you right click the column in the table that you're using now, you'll get a menu like this:

GregMarbais_0-1666809008527.png

 

Then you can add those two values to one group - just make sure you make a group for the orange and purple/red values as well.

GregMarbais_1-1666809092619.png

 

That will add a Group to the table where you can drag it into the legend well for the visual.

GregMarbais_3-1666809204400.png

Just know that it would be that way across the whole visual so you would be combining two blue values for both State and County 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.