Forum Discussion
bar chart total issue
- 1 year ago
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
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.
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
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
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...
- v-hjannapu1 year agoCommunity Support
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 itBest Regards,
Harshitha.
Community Support Team- mogugu_841 year agoHelper I
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
- v-hjannapu1 year agoCommunity Support
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