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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ARomain
Helper I
Helper I

DistinctCount Names by ID

1

Mike
1Mike
2Eli
3Paul
3Mike
3

Stephen

 

I am trying to distinct count names (using a measure) by the ID. If an ID has the same name, I only need it counted once. However, the same name in different IDs have to be counted separately. 

 

I want to get the data as below

ID 1: 1 Name

ID 2: 1 Name

ID 3: 3 Names

Total: 5

 

If I just use Calculate(DistinctCount(Name)), I would only get a value of 4. 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ARomain , Create a measure like

 

countrows(summarize(Table, Table[ID], Table[Name]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
HotChilli
Community Champion
Community Champion

I think you can use your measure with an iterator:

SUMX(VALUES(Table[ID]),  yourMeasure))
amitchandak
Super User
Super User

@ARomain , Create a measure like

 

countrows(summarize(Table, Table[ID], Table[Name]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.