Forum Discussion

KieuVuong's avatar
KieuVuong
Frequent Visitor
3 years ago
Solved

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 ...
  • Jakinta's avatar
    3 years ago

    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