Forum Discussion
DoubleTap
2 years agoNew Member
Need help finding duplicate Id's
I think i have a relatively easy ask but im going crazy. I have a table where i need to count the duplicate Id's. I create a simple count measure [ ID_Cnt=count(Id) ] then created another measure to ...
- 2 years ago
Duplicates = var aaa = ADDCOLUMNS(VALUES('Table'[ID]), "count id", CALCULATE(COUNT('Table'[ID]))) return IF( HASONEVALUE('Table'[ID]), SUMX(aaa, [count id]), SUMX(FILTER(aaa, [count id] > 1), [count id]) )EDIT - misread the requirements, have changed the calculation. The above is my attempt. I hope it helps!
vicky_
Super User
2 years ago
Duplicates =
var aaa = ADDCOLUMNS(VALUES('Table'[ID]), "count id", CALCULATE(COUNT('Table'[ID])))
return IF(
HASONEVALUE('Table'[ID]), SUMX(aaa, [count id]),
SUMX(FILTER(aaa, [count id] > 1), [count id])
)
EDIT - misread the requirements, have changed the calculation. The above is my attempt. I hope it helps!
DoubleTap
2 years agoNew Member
Works perfectly thank you so much!