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
mogugu_84
Helper I
Helper I

bar chart total issue

I have a simple stacked bar chart like the below, each color is like one State, and the measure is like "sum of units", very simple, 

i.e. like the below in March, the 7 States adds up to totally 4519 units, which is the correct number.

mogugu_84_0-1747234784198.png

 i also have a 2nd layer of the geogrphy, which is "City", each State above are consisted by a bunch of Cities. When i put "City" into the legend instead of the "State", the total is less (consistantly each month), see below, March is only 4,283 units. 

mogugu_84_1-1747235014385.png

the part that i can't diagnose is that i filtered for each State in the city view chart, for example, below is the city breakdown for bottom State (see the State view chart), dark green color, showing 607 units, and the breakdown below adds up to 607 correctly. i checked all State individually, it's all correct. 

mogugu_84_2-1747235202498.png

i also check the "show as table" for the total city view, each number of March adding together still equals 4719, but why the bar total shows 4283....anyone knows why?

mogugu_84_3-1747235408974.png

 

1 ACCEPTED SOLUTION

Hi @mogugu_84 ,

If all cities have values, the matrix and stacked bar chart totals should match. The issue is that Power BI’s stacked bar chart may skip some cities due to its data reduction for performance, causing a lower total than the matrix which shows all data, like your correct 4708 total. Zero value cities might add rows in the matrix but don’t affect the sum, so the discrepancy is purely visual.

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.
Community Support Team

View solution in original post

11 REPLIES 11
v-hjannapu
Community Support
Community Support

Hi @mogugu_84,
Thank you @ExcelMonke, for your response regarding the Issue.
Thank you for reaching out to the Microsoft fabric community forum.

Here are the few steps which you may follow to resolve the issue :
1.Make sure that the relationship between your tables is properly established.
2. Ensure Your DAX correctly sums the Total Units at both the State and City levels.

vhjannapu_1-1747377921698.png


Please find the attached file for your reference.
If you're still facing any issues, consider sending sample data.

You can refer the following links:

How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Solved: How to upload PBI in Community - Microsoft Fabric Community

Hope this helps!
If the response has addressed your query, please accept it as a solution and give a'Kudos' so other members can easily find it.
Thank You!

 

Hi

thank you, I'm travelling at the moment but will definitely check and feedback as soon as I can. 

Hi @mogugu_84 ,

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. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.

 

Best Regards,
Harshitha.
Community Support Team.

Hi @mogugu_84,

May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Best Regards,
Harshitha.
Community Support Team.

Hi @mogugu_84,
Just wanted to check if you had the opportunity to review the suggestion provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank You.

ExcelMonke
Super User
Super User

Hello,

Without knowing much about how your data is set up, it is difficult to say if this is a DAX formula issue or a data issue. I would need to know a little bit more about how the data is set up. One thing to consider is to check whether your Location Dim table (the table where you have your state/city) information is set up correctly. i.e. Do all the cities have state values, and vice versa. 

One way to continue diagnosing is to create a matrix, where your rows are State, City, and from there see if you are able to determine which cities (or blanks!) are not returning any results. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi ExcelMonke

thanks for your suggestion on using a matrix table, here's some updated information:

 

when not expanded, just showing at the State (provincia) level, the table and bar chart is aligned

 

mogugu_84_0-1748322454418.png

simply expand the matrix table, the total is still correct in the table, but when replacing the legend to city in the bar chart, the total reduces

mogugu_84_2-1748323503667.png

 

there's no DAX formula for the measure, it's just a simply auto sum of a column called "Units"

I have also double check the relationship structure between State and City, it's all unique otherwise the matrix table won't be correct anyway? it's really weird...

 

Hi @mogugu_84,

The matrix includes all rows even those with blanks or zero values while the bar chart automatically excludes categories (cities) with blank or zero totals from the visual, which causes the total to reduce.

This behavior is expected in visuals like stacked bar charts, as Power BI doesn’t display or count in total height categories with no visible bars.

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.
Community Support Team

@v-hjannapu thank you, but this doesn't seem to be the answer to the issue, firstly, in this case, even in the matrix, all cities has a value, therefore it should be the same for the bar chart. plus even if there are zero value cities, it may display more rows in the matrix than in the bar chart, but the SUM total should still be the same

 

mogugu_84_0-1748521888393.png

 

Hi @mogugu_84 ,

If all cities have values, the matrix and stacked bar chart totals should match. The issue is that Power BI’s stacked bar chart may skip some cities due to its data reduction for performance, causing a lower total than the matrix which shows all data, like your correct 4708 total. Zero value cities might add rows in the matrix but don’t affect the sum, so the discrepancy is purely visual.

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.
Community Support Team

Hi 

thanks but as i described that all cities do have values, and the total does not match. 

please see the sample pbix file here

https://drive.google.com/file/d/1RJWD3k7g0xH886iREEC1cywWCnnWzlzV/view?usp=sharing

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.