Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Hi,
Were you able to resolve this issue? am facing the same
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.
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?
User | Count |
---|---|
77 | |
75 | |
46 | |
31 | |
28 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
46 |