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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KieuVuong
Frequent Visitor

Remove Duplicate based on multi-conditions

Hi all

I have one trouble working with Removing Duplicate with conditions in Power Query. Could you please help?

 

I have table with 3 columns as below:

 

Article  Strategy  Supplier
11 Same Main
11 Increase Main
12 Same Main
12 Increase Main
11 Same David
11 Increase David

 

I have requirement from my work as:

- If the Articles and Strategy are duplicate, then choose Supplier David (delete Supplier Main) --> example article 11

 

And the desire result is 

Article  Strategy Supplier
11 Same David
11 Increase David
12 Same Main
12 Increase Main

 

Could you please help me on that?

 

Thank you in advance!

1 ACCEPTED SOLUTION
Jakinta
Solution Sage
Solution Sage

You can try steps below after your Source step.

 

    Grouped = Table.Group(Source, {"Article", "Strategy"}, {{"A", each let t = _ in if  Table.RowCount (t) > 1 then Table.SelectRows(t, each ([Supplier] = "David")) else t , type table [#"Article "=number, Strategy=text, #" Supplier"=text]}}),
    Expanded = Table.ExpandTableColumn(Grouped, "A", {"Supplier"}, {"Supplier"})
in
    Expanded

View solution in original post

1 REPLY 1
Jakinta
Solution Sage
Solution Sage

You can try steps below after your Source step.

 

    Grouped = Table.Group(Source, {"Article", "Strategy"}, {{"A", each let t = _ in if  Table.RowCount (t) > 1 then Table.SelectRows(t, each ([Supplier] = "David")) else t , type table [#"Article "=number, Strategy=text, #" Supplier"=text]}}),
    Expanded = Table.ExpandTableColumn(Grouped, "A", {"Supplier"}, {"Supplier"})
in
    Expanded

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Kudoed Authors