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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Sriku
Helper IV
Helper IV

Calculate unique count of Customer

Hi, I need to calculate unquie clients for each whether the status is either Profit/loss. How to achieve it

CustomerProductStatus
AP1Profit
AP2Profit
AP3Loss
BP1Profit
BP2Profit
BP3Loss
CP1Loss
CP2Loss
CP3Loss
2 ACCEPTED SOLUTIONS
Pragati11
Super User
Super User

Hi @Sriku ,

 

I am not sure what shape the output is required here. But you can do something as below:

Consider following input:

Pragati11_0-1599725258108.png

 

You can get the following output as follows: You basically have Unique Customer count for every status.

 

Pragati11_1-1599725306857.png

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

v-rzhou-msft
Community Support
Community Support

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.

4.png

1. Count the status for per client.

You can build a measure or use the way like  provided to you.

 

Measure1 = COUNTX(FILTER('Table','Table'[Customer]=MAX('Table'[Customer])&&'Table'[Status]=MAX('Table'[Status])),'Table'[Product])

 

Or 

2.png

Result:

1.png

2. Count the distinct client for each status by measure.

 

Measure2 = DISTINCTCOUNT('Table'[Customer])

 

Result:

3.png

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. 

View solution in original post

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

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

v-rzhou-msft
Community Support
Community Support

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.

4.png

1. Count the status for per client.

You can build a measure or use the way like  provided to you.

 

Measure1 = COUNTX(FILTER('Table','Table'[Customer]=MAX('Table'[Customer])&&'Table'[Status]=MAX('Table'[Status])),'Table'[Product])

 

Or 

2.png

Result:

1.png

2. Count the distinct client for each status by measure.

 

Measure2 = DISTINCTCOUNT('Table'[Customer])

 

Result:

3.png

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. 

amitchandak
Super User
Super User

@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])

Pragati11
Super User
Super User

Hi @Sriku ,

 

I am not sure what shape the output is required here. But you can do something as below:

Consider following input:

Pragati11_0-1599725258108.png

 

You can get the following output as follows: You basically have Unique Customer count for every status.

 

Pragati11_1-1599725306857.png

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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