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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JVDW_VSH
Frequent Visitor

Labels on stacked bar chart: total labels when filtered and not filtered

I have a (horizontal) stacked bar chart that shows my measure (total_number) for projects. There are a few categories the total number can be counted for so that's what I use in the legend (category).

I would like to achieve the following:

I want to show total labels only: showing the total_number for all categories in the stacked bar. So far so good.

But when I filter on one category, I would like to see the total_numer for that category only. Unfortunately in this case no total labels are shown anymore.

I don't want to see both data labels in the stacks. only total labels.

 

Please help

4 REPLIES 4
VidyaS
New Member

Hi,

 

Were you able to resolve this issue? am facing the same

Anonymous
Not applicable

Hi @JVDW_VSH 

Can you provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

Kedar_Pande
Super User
Super User

@JVDW_VSH 

Total_Number = SUM(Table[total_number])

Create a new measure

Total_Label = 
IF(
ISFILTERED(Table[category]),
CALCULATE(SUM(Table[total_number]), ALL(Table[category])),
[Total_Number]
)

Make sure to turn off the data labels for the individual categories to avoid displaying both total and category labels.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Hi Kedar,

 

Thanks for your response.
Unfortunately this doesn't work as expected: there is always a label in each stack, while I only need a total label (but also when another visual filters this one). I guess this is what filter context does for this kind of visual. 
Secondly the legend is filtered already (but I could work around this if I found the right solution.)

 

Any further ideas how to ONLY show labels outside of the bars: either the total for several stacks or the total for the stack(s) that is there when another visual filters this one?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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