Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 identify the dups [ Duplicate_Cnt = if(ID_Cnt > 1), 1 , 0) ]. It just adds up all the Id's as if the condition wasnt even there. I would like to be to have the total number of duplicates associated with the ID and one measure that has the total count of all overall dups.
Any help is appreciated.
Here is an example of the data and my desired output:
Duplicates = 5
| Data | ID | Date | Result | ID | Dups | |
| 1 | 1/1/2021 | 1 | 1 | |||
| 9 | 1/2/2021 | 2 | 2 | |||
| 2 | 1/3/2021 | 4 | 1 | |||
| 4 | 1/4/2021 | 7 | 1 | |||
| 7 | 1/5/2021 | 9 | 3 | |||
| 9 | 1/2/2021 | |||||
| 9 | 1/2/2021 | |||||
| 2 | 1/3/2021 |
Solved! Go to Solution.
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!
Hi @DoubleTap ,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
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!
Works perfectly thank you so much!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |