Forum Discussion

icedavies's avatar
icedavies
Frequent Visitor
2 years ago
Solved

Removing Duplicates in Power Query based on X

Hi, I'm having a bit of trouble and hoping someone can help 🙂 I have a table with duplicates reference numbers in a column, lets call it "Ref Numbers". I also have another column which I will c...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi icedavies 

     

    In Power Query, select all the columns right-click and select the Remove Duplicates

    Then try this code:

     

    = Table.Group(#"Removed Duplicates", {"Ref Numbers"}, {{"Count", each if Table.RowCount(_) >1 then Table.SelectRows(_, each [Decider] = "RNS") else _ , type table }})

     

    Select the Decider in the  :

    The result is as follow:

     

     

    Best Regards

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