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

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

Reply
Anonymous
Not applicable

Distinctcount with filters

Hi all, 

 

Since I'm new to PowerBI and DAX the following question.. 

I'm trying to count the number of clients that are purchasing a certain service. Example of table (services):

 

Clientnmbr       Service
11         A
11         B
25         A
37         A

37         B

37         C
44         A
54         A
54         C
65         C


I'm looking for a dax-formula that counts the number of clients (distinctcount) that use 1 service (answer=1), 2 services (answer=2) or 3 services (answer=1)... 

 

Thanks! Steven

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You could create a calculated table showing the number of services by client:

SUMMARIZE('Table', Clientnmbr, "ServiceCount", DISTINCTCOUNT('Table'[Service])

Or use that inside of any other DAX. But of you want to be able to filter on the number you need a calculated table since you can't filter on measures.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Distinct clients = DISTINCTCOUNT('Table'[Clientnmbr])

(use if you want to filter on service in report)

 

Distinct clients service A = CALCULATE([Distinct clients], KEEPFILTERS('Table'[Service]="A"))

(use if you want a new mesure for a specific service)

 

or combine like this:

Distinct clients service A = CALCULATE(DISTINCTCOUNT('Table'[Clientnmbr]), KEEPFILTERS('Table'[Service]="A"))

Tahreem24
Super User
Super User

@Anonymous ,

 

Create a mesure like below:

 

DistinctCount = DISTINCTCOUNT('TableName'[Client])

 

Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Anonymous ,

 

After creating DAX measure you'll get expected output as per below screen shot:

Measure = DISTINCTCOUNT('TableName'[ClientID])
 
Capture.JPG
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Thanks, but this shows the number of times that a specific service is used. I'm looking for the formula that shows the # of clients that use 1, 2 or 3 services. 

Anonymous
Not applicable

You could create a calculated table showing the number of services by client:

SUMMARIZE('Table', Clientnmbr, "ServiceCount", DISTINCTCOUNT('Table'[Service])

Or use that inside of any other DAX. But of you want to be able to filter on the number you need a calculated table since you can't filter on measures.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.