Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi, I need to calculate unquie clients for each whether the status is either Profit/loss. How to achieve it
Customer | Product | Status |
A | P1 | Profit |
A | P2 | Profit |
A | P3 | Loss |
B | P1 | Profit |
B | P2 | Profit |
B | P3 | Loss |
C | P1 | Loss |
C | P2 | Loss |
C | P3 | Loss |
Solved! Go to Solution.
Hi @Sriku ,
I am not sure what shape the output is required here. But you can do something as below:
Consider following input:
You can get the following output as follows: You basically have Unique Customer count for every status.
Thanks,
Pragati
Hi @Sriku
Due to I don't know what result you want, I calculate two results for you. And I use your table to have a test.
1. Count the status for per client.
You can build a measure or use the way like Pragati11 provided to you.
Measure1 = COUNTX(FILTER('Table','Table'[Customer]=MAX('Table'[Customer])&&'Table'[Status]=MAX('Table'[Status])),'Table'[Product])
Or
Result:
2. Count the distinct client for each status by measure.
Measure2 = DISTINCTCOUNT('Table'[Customer])
Result:
If this reply still couldn't help you solve your problem, please show me the result you want to get or tell me your calculate logic.
You can download the pbix file from this link: Calculate unique count of Customer
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Sriku
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou
Hi @Sriku
Due to I don't know what result you want, I calculate two results for you. And I use your table to have a test.
1. Count the status for per client.
You can build a measure or use the way like Pragati11 provided to you.
Measure1 = COUNTX(FILTER('Table','Table'[Customer]=MAX('Table'[Customer])&&'Table'[Status]=MAX('Table'[Status])),'Table'[Product])
Or
Result:
2. Count the distinct client for each status by measure.
Measure2 = DISTINCTCOUNT('Table'[Customer])
Result:
If this reply still couldn't help you solve your problem, please show me the result you want to get or tell me your calculate logic.
You can download the pbix file from this link: Calculate unique count of Customer
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Sriku , Not very clear , refer if these three can help
Loss Making = countx(filter(summarize(Table, Table[Customer], "_1", countx(filter(Table,[Status]="Profit"),Table[Product])+0
, "_2", countx(filter(Table,[Status]="Loss"),Table[Product])+0), [_1]=0, [_2]>0),[Customer])
Profit Making = countx(filter(summarize(Table, Table[Customer], "_1", countx(filter(Table,[Status]="Profit"),Table[Product])+0
, "_2", countx(filter(Table,[Status]="Loss"),Table[Product])+0), [_1]>0, [_2]=0),[Customer])
Loss/ Profit Making = countx(filter(summarize(Table, Table[Customer], "_1", countx(filter(Table,[Status]="Profit"),Table[Product])+0
, "_2", countx(filter(Table,[Status]="Loss"),Table[Product])+0), [_1]>0, [_2]>0),[Customer])
Hi @Sriku ,
I am not sure what shape the output is required here. But you can do something as below:
Consider following input:
You can get the following output as follows: You basically have Unique Customer count for every status.
Thanks,
Pragati
User | Count |
---|---|
98 | |
90 | |
84 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |