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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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