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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Keerthi_CH
Microsoft Employee
Microsoft Employee

Stacked Column Chart Displays Incorrect Total Values After Adding Legend

Hi Everyone,

I'm facing an issue with a Stacked Column Chart in Power BI and would appreciate your help.

Scenario:

  • The visual displays the correct total values when no Legend field is added.
  • After adding OwningTeamName to the Legend, the total values on the columns decrease and no longer match the expected totals.
  • I have verified the underlying data using a Table visual, and the values are correct there.
  • The issue occurs only in the Stacked Column Chart after adding the legend.

Current Setup:

  • X-axis: MitigateDate (Month)
  • Y-axis: IncidentId (Count)
  • Legend: OwningTeamName

For example:

  • Without the legend, the monthly totals are correct (e.g., May = 234).
  • After adding the legend, the same month shows a reduced total (e.g., May = 141), even though the table visual still displays the correct data.

Has anyone encountered a similar issue? 

Any suggestions or guidance would be greatly appreciated.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Keerthi_CH ,

Adding `OwningTeamName` to the Legend should not reduce the monthly total by itself. In a stacked column chart, the total of the column should normally be the sum of all visible legend segments for that month.

If the total changes after adding the Legend, it usually means that the Legend field is changing the filter context or that some incident records cannot be assigned to a valid `OwningTeamName`.

I would suggest checking the following points:

1. Check for blank or missing OwningTeamName values

Some incidents may have a blank/null `OwningTeamName`.
When the chart does not use a Legend, those incidents are included in the total count.
But when you add `OwningTeamName` as a Legend, Power BI has to split the incidents by team. If some incidents do not belong to any team, they may not appear as part of the stacked segments, especially if blanks are filtered out.

For example, if May shows 234 without the Legend and 141 with the Legend, the missing 93 incidents may be records where `OwningTeamName` is blank or not matched.

2. Check whether OwningTeamName comes from a related dimension table

If `OwningTeamName` comes from a separate Team/Owner dimension table, check the relationship between that table and the incident/fact table.

If some incident records do not have a matching key in the team dimension, they can be counted when no Legend is used, but excluded or grouped differently once the Legend is added.

3. Use an explicit measure instead of the implicit Count

Instead of dragging `IncidentId` directly to the Y-axis and relying on the implicit Count aggregation, I recommend creating an explicit measure.

For example, if each `IncidentId` should be counted once:

Incident Count =
DISTINCTCOUNT ( Incidents[IncidentId] )

Or, if each row in the table represents one incident:

Incident Count =
COUNTROWS ( Incidents )

Then use this measure in the Y-axis of the stacked column chart.

4. Create a debugging table

To identify where the difference comes from, create a table visual with:

- MitigateDate Month
- OwningTeamName
- Incident Count

Then compare the monthly total in the table with the stacked column chart.

Also add a check for blank teams, for example:

Blank Team Incident Count =
CALCULATE (
[Incident Count],
ISBLANK ( Incidents[OwningTeamName] )
)

If the missing difference appears under blank or unmatched teams, that explains why the total changes after adding the Legend.

5. Check visual-level filters and interactions

Also verify that there are no filters applied only to the stacked column chart, such as:

- Visual-level filters excluding blank values
- Top N filters
- Cross-filtering from another visual
- Page/report filters affecting `OwningTeamName`
- A filter on the Legend field itself

In short, I do not think the issue is caused by the stacked column chart itself. Most likely, adding the Legend exposes a data/model issue, such as blank teams, missing relationships, unmatched dimension values, or a different aggregation behavior.

If possible, please share a sample PBIX file with dummy data, or at least screenshots of the data model relationships and the fields used in the visual. That would make it much easier to identify exactly why the total changes when `OwningTeamName` is added to the Legend.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
v-saisrao-msft
Community Support
Community Support

Hi @Keerthi_CH,

Checking in to see if your issue has been resolved. let us know if you still need any assistance.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @Keerthi_CH,

Have you had a chance to review the solution shared by the @krishnakanth240 @Ritaf1983 @Shai_Karmani? If the issue persists, feel free to reply so we can help further.

 

Thank you.

krishnakanth240
Super User
Super User

Hi @Keerthi_CH 

Totals drop because adding a Legend changes filter context. The chart recalculates counts per team, so implicit aggregation of IncidentId no longer matches the overall total. You can use explicit measure 

Incident Count = COUNTROWS('Incidents')

Or force totals with

SUMX(VALUES('Incidents'[OwningTeamName]), COUNTROWS('Incidents'))

This ensures stacked totals equal the table totals

Ashish_Mathur
Super User
Super User

Hi,

Please share the download link of the PBI file and show the problem there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi @Keerthi_CH ,

Adding `OwningTeamName` to the Legend should not reduce the monthly total by itself. In a stacked column chart, the total of the column should normally be the sum of all visible legend segments for that month.

If the total changes after adding the Legend, it usually means that the Legend field is changing the filter context or that some incident records cannot be assigned to a valid `OwningTeamName`.

I would suggest checking the following points:

1. Check for blank or missing OwningTeamName values

Some incidents may have a blank/null `OwningTeamName`.
When the chart does not use a Legend, those incidents are included in the total count.
But when you add `OwningTeamName` as a Legend, Power BI has to split the incidents by team. If some incidents do not belong to any team, they may not appear as part of the stacked segments, especially if blanks are filtered out.

For example, if May shows 234 without the Legend and 141 with the Legend, the missing 93 incidents may be records where `OwningTeamName` is blank or not matched.

2. Check whether OwningTeamName comes from a related dimension table

If `OwningTeamName` comes from a separate Team/Owner dimension table, check the relationship between that table and the incident/fact table.

If some incident records do not have a matching key in the team dimension, they can be counted when no Legend is used, but excluded or grouped differently once the Legend is added.

3. Use an explicit measure instead of the implicit Count

Instead of dragging `IncidentId` directly to the Y-axis and relying on the implicit Count aggregation, I recommend creating an explicit measure.

For example, if each `IncidentId` should be counted once:

Incident Count =
DISTINCTCOUNT ( Incidents[IncidentId] )

Or, if each row in the table represents one incident:

Incident Count =
COUNTROWS ( Incidents )

Then use this measure in the Y-axis of the stacked column chart.

4. Create a debugging table

To identify where the difference comes from, create a table visual with:

- MitigateDate Month
- OwningTeamName
- Incident Count

Then compare the monthly total in the table with the stacked column chart.

Also add a check for blank teams, for example:

Blank Team Incident Count =
CALCULATE (
[Incident Count],
ISBLANK ( Incidents[OwningTeamName] )
)

If the missing difference appears under blank or unmatched teams, that explains why the total changes after adding the Legend.

5. Check visual-level filters and interactions

Also verify that there are no filters applied only to the stacked column chart, such as:

- Visual-level filters excluding blank values
- Top N filters
- Cross-filtering from another visual
- Page/report filters affecting `OwningTeamName`
- A filter on the Legend field itself

In short, I do not think the issue is caused by the stacked column chart itself. Most likely, adding the Legend exposes a data/model issue, such as blank teams, missing relationships, unmatched dimension values, or a different aggregation behavior.

If possible, please share a sample PBIX file with dummy data, or at least screenshots of the data model relationships and the fields used in the visual. That would make it much easier to identify exactly why the total changes when `OwningTeamName` is added to the Legend.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Shai_Karmani
Super User
Super User

This is almost always because some IncidentId rows have a blank OwningTeamName. A stacked column drops rows where the legend value is blank, so those incidents disappear once you add the legend (May going from 234 to 141 suggests roughly 93 incidents with no team).

Quickest test: put OwningTeamName in a table visual with Count of IncidentId and look for a (Blank) row.

The cleanest fix is in Power Query. Select the OwningTeamName column, Transform > Replace Values, leave Value To Find empty and set Replace With to Unassigned. After refresh the legend will include that bucket and the totals will match again.

If OwningTeamName comes from a separate dimension table, also check the relationship. Any IncidentId whose team value does not exist in that dimension will be filtered out the same way.

 

If this helped, please mark it as the accepted solution and give a thumbs up.

 

Best,
Shai Karmani

 

Let's connect in LinkedIn

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors