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
onedayover
Helper III
Helper III

Remove rows in Power Query based on duplicates in one column and a specific value in another

Hi All

I have a table that has duplication in the rows with the exception of 1 column. I've tried to remove certain rows by maniplating some examples which I found but am having trouble trying to get the end result I need.

What I'm trying to do in power query is to remove the entire row if there are any duplicates in the "itemid" column and there is also a "D" in the "Status" column. Here is a before and after look of what I'm trying to do...

onedayover_0-1669337932650.png

Would anyone know if or how I can achieve this?

Thanks

onedayover

1 ACCEPTED SOLUTION
MahyarTF
Memorable Member
Memorable Member

Hi,

This is my solution based on the sample data :

1- I created the Duplicated columns for the ItemId and Status

2- Merge created columns (Copy-Itemid and Copy-Status)

MahyarTF_0-1669340183384.png

3- Sort rows Ascending on the Merged column :

MahyarTF_1-1669340233165.png

4- Select the Columns (as below) and remove the duplicated records :

MahyarTF_3-1669340623830.png

Also, you could delete the merged column

Appreciate your Kudos and please mark it as a solution if it helps you.

Mahyartf

View solution in original post

3 REPLIES 3
MahyarTF
Memorable Member
Memorable Member

Hi,

This is my solution based on the sample data :

1- I created the Duplicated columns for the ItemId and Status

2- Merge created columns (Copy-Itemid and Copy-Status)

MahyarTF_0-1669340183384.png

3- Sort rows Ascending on the Merged column :

MahyarTF_1-1669340233165.png

4- Select the Columns (as below) and remove the duplicated records :

MahyarTF_3-1669340623830.png

Also, you could delete the merged column

Appreciate your Kudos and please mark it as a solution if it helps you.

Mahyartf

Works perfectly, thank you MahyarTF, your help is much appreciated 🙂

Hi @onedayover 

Glad to help any time 

Mahyartf

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.