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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jb1234
New Member

Values in Bar Chart are not correct

I have the following table and resulting bar chart.

Table2.JPGChart2.JPG

 

I am trying to create a stacked bar chart that that displays the count of  unique customers that meet the threshold of >=500 for at least one product and the count of unique customers that do not have at least 1 product that is >=500.   The stacked bar chart has the Year & Month as the x axis, the threshold as the legend and the customer name as the value.

 

For example, Customer 1 has 2 products that are greater than 500 so I need to count that as 1 since it is just one customer.  Customer 2 does not have any that >=500 so I need to count Customer 2 as not meeting the threshold. Customer 3 has Product A which is = 500 so I need to count that Customer as meeting the threshold. 

 

My problem is the numbers displayed in the bar chart count customer 1 twice since there are 2 rows Product B & D that are >=500.  Selecting  count distinct for the "value" setting of the bar chart does not help.  If I change the bar chart to a card which displays the total that number is accurate because it is using the count distinct for the value but if you manually add the numbers in the bar chart for yes and no it is not accurate as it is counting rows not unique customers.

 

What is the best way for me to count unique customers in this scenario?  Create a calculated column, a measure, do some type of grouping?

 

Any help would be appreciated.

 

Thanks.

1 REPLY 1
v-qiuyu-msft
Community Support
Community Support

Hi @jb1234,

 

Please try to create measures below:

 

Meets Threshold(Yes) = CALCULATE(DISTINCTCOUNT('Table1'[Customer Name]),FILTER(Table1,'Table1'[Meets Threshold?]="Yes"))

Meets Threshold(No) = IF('Table1'[Meets Threshold(Yes)]=BLANK(),CALCULATE(DISTINCTCOUNT('Table1'[Customer Name]),FILTER(Table1,'Table1'[Meets Threshold?]="No")),BLANK())

 

q1.PNG

 

 

If above measure doesn't work, please clarify the desired results for our analysis.

 

Best Regards,
QiuyunYu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.