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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ADC
Frequent Visitor

Show Total in Stacked Column Chart with legend

Hi Community

I have a stacked column chart showing the number of docs checked by month, separated in categories A, B and C.

I get each individual value, but I also need the graphic to show the total (A + B + C) for each month (on top of each column).

Is this possible?

 

columnchart.png

1 ACCEPTED SOLUTION

@ADC,

Create another three measures in your table, and create Stacked Column chart as shown in the screenshot below.

A = CALCULATE(SUM(Table[docs number]),FILTER(Table,Table[Category]="A"))
B = CALCULATE(SUM(Table[docs number]),FILTER(Table,Table[Category]="B"))
C = CALCULATE(SUM(Table[docs number]),FILTER(Table,Table[Category]="C"))
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

8 REPLIES 8
SonjaBerrios
Advocate I
Advocate I

If you use a line and stacked column chart visual, then you can make the line be the total amount.  Go to the formatting section for the visual and expand the Shapes section, then change the Stroke width to 0 so the line won't show.  Next go to the Data labels section and turn on Customize series.  Then you can change the color and font size of the total value so it is different than the other data labels.

SonjaBerrios
Advocate I
Advocate I

If you go to the formatting for the bar chart with a line, expand the Shapes section, and change the Stroke width to 0, then the line doesn't show

v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@ADC,

You can create a measure as follows to calculate the total docs number for each month.
total = CALCULATE(SUM(Table[docs number]),ALLSELECTED(Table[Month]))

However, in stacked column chart, when you drag field to Legend, it is not possible to drag more than one fields to Values. You can switch to use Line and stacked column chart and create the chart as shown in the following screenshot.

1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Lydia,

Thanks a lot for your answer.

It is a nice workaround and I get the total sum shown in the graphic that way.

However, I was wandering if the total sum of the categories can be shown in each column, on top of the column.

I need that very frequently and the Line sometimes generates confusion on the audience.

Any other way to handle it?

Thanks again.

Regards.

Alejandro

@ADC,

Create another three measures in your table, and create Stacked Column chart as shown in the screenshot below.

A = CALCULATE(SUM(Table[docs number]),FILTER(Table,Table[Category]="A"))
B = CALCULATE(SUM(Table[docs number]),FILTER(Table,Table[Category]="B"))
C = CALCULATE(SUM(Table[docs number]),FILTER(Table,Table[Category]="C"))
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuezhe-msft 

 

This works if you only have a few values, but if you have hundreds of values this becomes tedious

Anonymous
Not applicable

Filters are not working for indvidual category it select whole x axis as filter.

Anonymous
Not applicable

we can use drill down feature of power bi to filter seleted pane so we can filter that selected pane data.

for filter purpose use category of the given pane in axis field.Screenshot (4).pngScreenshot (5).png

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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