Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have the following table and resulting bar chart.
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.
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())
If above measure doesn't work, please clarify the desired results for our analysis.
Best Regards,
QiuyunYu
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
75 | |
56 | |
50 | |
44 |