Forum Discussion
Incorrect Total in Power BI Bar Chart When Using Legend
- 8 months ago
HI losbrincos2 ,
A bar chart total only stays correct when both the numerator and denominator of your measure aggregate the same way across all slices. In your model, one part of the calculation (like Technicians, Gross Team Capacity, or something coming from the Coordination dimension) is likely aggregating differently at the total level than at the category level. This usually happens when there’s mixed granularity (e.g., bookings by day but capacity by month), duplicated or unmatched keys in the Coordination table, or a denominator that isn't additive (such as DISTINCTCOUNT). Once a legend is added, Power BI splits the visual into multiple filter contexts, which forces the denominator to recalculate and that’s why the total shifts only after the legend is introduced. To fix it, validate granularity, make sure the Coordination dimension has clean unique keys, and confirm that the denominator measure behaves the same at both row and total levels. Any filter sensitive part of the measure will cause the total to change whenever a legend is applied.
Hi losbrincos2 ,
I would also take a moment to thank Kedar_Pande , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions
- losbrincos28 months agoRegular VisitorThank you very much for your assistance. Over the weekend, I minimized the data model as much as possible to run a controlled test. I kept only the essential components, and the issue still occurs as soon as I include the coordination dimension. Based on what I’ve been reading, it seems that when a legend is added to a visual, Power BI recalculates the totals by grouping categories, which could be causing the incorrect behavior. Do you have any detailed information on this?with legend 20,02with out legend (correct value) 20,01
In a table it always looks fine, the problem is when I include the legend. I don't know if you know anything about this; I’ve already asked the community as well (without success). The only recommendation I’ve received is to add a totals table on the right or even include it discreetly inside the chart, but it looks really ugly. Thanks a lot for your help.
RegardsDavid.- v-sshirivolu8 months agoCommunity Support
HI losbrincos2 ,
A bar chart total only stays correct when both the numerator and denominator of your measure aggregate the same way across all slices. In your model, one part of the calculation (like Technicians, Gross Team Capacity, or something coming from the Coordination dimension) is likely aggregating differently at the total level than at the category level. This usually happens when there’s mixed granularity (e.g., bookings by day but capacity by month), duplicated or unmatched keys in the Coordination table, or a denominator that isn't additive (such as DISTINCTCOUNT). Once a legend is added, Power BI splits the visual into multiple filter contexts, which forces the denominator to recalculate and that’s why the total shifts only after the legend is introduced. To fix it, validate granularity, make sure the Coordination dimension has clean unique keys, and confirm that the denominator measure behaves the same at both row and total levels. Any filter sensitive part of the measure will cause the total to change whenever a legend is applied.
- v-sshirivolu8 months agoCommunity Support
Hi losbrincos2 ,
I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.