Forum Discussion
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.
Hi Athenafordata ,
This is my test table:
The chart visual:
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])I think this is the result you want:
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.
2 Replies
- GregMarbais
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:
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.
That will add a Group to the table where you can drag it into the legend well for the visual.
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
- v-yadongf-msft
Community Support
Hi Athenafordata ,
This is my test table:
The chart visual:
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])I think this is the result you want:
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.