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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
v-stephen-msft
Community Support
Community Support

"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")
v-stephen-msft
Community Support
Community Support

"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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors