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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
michal_boro
Frequent Visitor

Issue with duplicated Rows

Hello All,

 

I ve got a table wich look like this

 

Specialist Customer ServiceSpecialist Invoicing and Settlement
Specialist Customer ServiceSpecialist Order Data Management
Specialist Invoicing and SettlementSpecialist Customer Service
Specialist Invoicing and SettlementSpecialist Order Data Management
Specialist Order Data ManagementSpecialist Customer Service
Specialist Order Data ManagementSpecialist Invoicing and Settlement

 

What i need to do is remove one of duplicated pair.

As you can see as first row there is:

Column1:  Spec. Cust. Serv and Column2: Spec Inv. and Sett.

and also in row third there is te same pair but in different order 

Column1: Spec Inv. and Sett. and Column2:  Spec. Cust. Serv.

 

From my point of view those are the same data and one of them have to be removed (doesnt matter which one).

No idea how to do it. Can you help?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

"Remov Dupliactes" is great, @AbhinavJoshi .
But removing the duplicate directly didn't provide @michal_boro  with the expected result.
Pease allow me to add that below are the detailed steps:

1.Create two custom columns, one is the result of column 1 merging column 2, and the other is the result of column 2 merging column 1.

vstephenmsft_0-1714529687793.pngvstephenmsft_1-1714529706793.png

vstephenmsft_3-1714529878273.png

 

2.Select C1C2 and C2C1 at the same time, then click "Unpivot Columns".

vstephenmsft_2-1714529735391.png

vstephenmsft_5-1714529983344.png

 

3.Select the Value column and remove duplicates.

vstephenmsft_4-1714529971352.png

vstephenmsft_6-1714530018676.png

4.Remove the Attribute column and the Value column.

vstephenmsft_7-1714530044552.png

 

5.Select the Column1 and the Column2 and remove duplicates again.

vstephenmsft_8-1714530057191.png

 

6.Here's your final result.

vstephenmsft_9-1714530149475.png

 

I upload the attachment for your reference. You can download it and go to Power Query Editor to check it.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
AlienSx
Super User
Super User

    add_col = Table.AddColumn(
        your_table, 
        "check", 
        each List.Sort(Record.FieldValues([[Column1], [Column2]]))
    ),
    distinct = Table.Distinct(add_col, "check"),
    rm_col = Table.RemoveColumns(distinct, "check")
Anonymous
Not applicable

"Remov Dupliactes" is great, @AbhinavJoshi .
But removing the duplicate directly didn't provide @michal_boro  with the expected result.
Pease allow me to add that below are the detailed steps:

1.Create two custom columns, one is the result of column 1 merging column 2, and the other is the result of column 2 merging column 1.

vstephenmsft_0-1714529687793.pngvstephenmsft_1-1714529706793.png

vstephenmsft_3-1714529878273.png

 

2.Select C1C2 and C2C1 at the same time, then click "Unpivot Columns".

vstephenmsft_2-1714529735391.png

vstephenmsft_5-1714529983344.png

 

3.Select the Value column and remove duplicates.

vstephenmsft_4-1714529971352.png

vstephenmsft_6-1714530018676.png

4.Remove the Attribute column and the Value column.

vstephenmsft_7-1714530044552.png

 

5.Select the Column1 and the Column2 and remove duplicates again.

vstephenmsft_8-1714530057191.png

 

6.Here's your final result.

vstephenmsft_9-1714530149475.png

 

I upload the attachment for your reference. You can download it and go to Power Query Editor to check it.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

You are amazing! It`s working. Thanks a loooot! 

michal_boro
Frequent Visitor

Nope, it`s gonna delete "random" row from column 2 also, i need to be sure that right pair stays.

AbhinavJoshi
Responsive Resident
Responsive Resident

Hello @michal_boro

 

You can use the remove duplicates in Power Query Editor. Select the column, here for example col1, right click and remove duplicates.

AbhinavJoshi_0-1714493963973.png

I hope it helps.


Thank you,

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.