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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Riccardo_O
New Member

Discrepancy in Legend Counts within Power BI Stacked Bar Chart

Hello,

 

I'm experiencing an issue with a stacked bar chart in Power BI and hope to find some guidance here. The chart is designed to display data across three dimensions:

  • Y-axis: Represents company names.
  • X-axis: Shows the distinct count of email addresses associated with each company.
  • Legend: Differentiates whether an email address has been contacted or not, marked as "Y" for yes and "N" for no.

Data Structure Overview:

  • Company Name: Indicates the name of the company.
  • Count of Email: Represents the distinct count of email addresses for each company.
  • Legend (Contacted): Shows whether each specific email address was contacted, with "Y" for yes and "N" for no.

 

Issue Encountered:

Based on the data from the CSV file, for example, Company_1 should have a count of 85 emails, with 44 marked as "Y" (contacted) and 41 marked as "N" (not contacted). However, in Power BI, while the company name and count of emails display correctly, the legend counts are incorrect. Instead of showing 44 "Y" and 41 "N", it displays 85 "Y" and 81 "N".

I've attached screenshots for a clearer understanding of the issue. It seems there's a discrepancy in how the "contacted" status is being counted or displayed in the legend.

 

Could anyone provide insights or guidance on how to correct these legend counts to accurately reflect the data? 

 

Thank you in advance for your assistance.

Screenshot 2024-02-19 153646.pngScreenshot 2024-02-19 153637.png

1 ACCEPTED SOLUTION

@amitchandak , Thank you very much for the answer. I found where the issaue was: There were some email addresses that had both conditions (Y and N). I used a different approach and now it is working.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Riccardo_O , Is count or distinctcount. If it distinctcount and both legends have values over some time. So need to check the data


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak , Thank you very much for the answer. I found where the issaue was: There were some email addresses that had both conditions (Y and N). I used a different approach and now it is working.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors