Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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. 

 

 

  • Anonymous , Create a measure like

     

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

2 Replies

  • Anonymous , Create a measure like

     

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

  • HotChilli's avatar
    HotChilli
    Community Champion

    I think you can use your measure with an iterator:

    SUMX(VALUES(Table[ID]),  yourMeasure))