Forum Discussion

DoubleTap's avatar
DoubleTap
New Member
2 years ago
Solved

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 ...
  • vicky_'s avatar
    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!