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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
waltw
Regular Visitor

Count duplicate values across multiple columns

Hello,

 

I am new to Power BI and am interested in understanding how to identify duplicates across multiple columns.

 

In Excel, I used the created a Duplicates column and add the formula below. I would look in the four columns E,I,J and K for rows with an exact match, and it would list in the Duplicates column the number of duplicates it encountered for that row (e.g. 2, 3, 9, etc.)

 

=SUMPRODUCT(--(E2&I2&J2&K2=$E$2:$E$100&$I$2:$I$100&$J$2:$J$100&$K$2:$K$100)

 

In Microsoft Access, I was able to simply use the Find Duplicates Query Wizard to achive the same result.

 

How do I do this in Power BI?

 

Thanks!

2 ACCEPTED SOLUTIONS

Maybe this is just language, but if you want to keep the dupilcates and count them, then surely you will end up with this.

 

                            First Name     Last Name  Address                               Number of Duplicates

Row XYZ               John               Smith          123 Sandpiper Lane             3

Row XYZ               John               Smith          123 Sandpiper Lane             3

Row XYZ               John               Smith          123 Sandpiper Lane             3

 

If you want to remove the duplciates and keep 1 copy of every row, then you will end up with this.

 

                            First Name     Last Name  Address                               Number of Duplicates

Row XYZ               John               Smith          123 Sandpiper Lane             3

 

You can also do this in Power Query.  Just select Group By, and then select Count.  The button is on the home tab to the right hand side of the menu



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

Yes, Advanced Grouping works. Thank you

View solution in original post

6 REPLIES 6
MattAllington
Community Champion
Community Champion

In power query (get data), you can highlight multiple columns and then either remove duplicates or keep duplicates. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thank you,

 

So I want to keep the duplicates, but I also want a "count" of how many duplicates I have. And those duplicates would be across multiple columns.

 

For example:

                             First Name     Last Name  Address

Row XYZ               John

waltw
Regular Visitor

Thank you,

 

So I want to keep the duplicates, but I also want a "count" of how many duplicates I have. And those duplicates would be across multiple columns.

 

For example:

                             First Name     Last Name  Address                               Number of Duplicates

Row XYZ               John               Smith          123 Sandpiper Lane             3

 

The number of duplicates column would show me that I have 3 duplicates of rows with this identical data.

I can do this in Excel and Access. How can I accomplish the same in Power BI?

 

Hi @waltw,

 

Have you tried the solution provided by @MattAllington above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

Yes, Advanced Grouping works. Thank you

Maybe this is just language, but if you want to keep the dupilcates and count them, then surely you will end up with this.

 

                            First Name     Last Name  Address                               Number of Duplicates

Row XYZ               John               Smith          123 Sandpiper Lane             3

Row XYZ               John               Smith          123 Sandpiper Lane             3

Row XYZ               John               Smith          123 Sandpiper Lane             3

 

If you want to remove the duplciates and keep 1 copy of every row, then you will end up with this.

 

                            First Name     Last Name  Address                               Number of Duplicates

Row XYZ               John               Smith          123 Sandpiper Lane             3

 

You can also do this in Power Query.  Just select Group By, and then select Count.  The button is on the home tab to the right hand side of the menu



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.