Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Conditionally remove duplicates in one column

Not sure how to do this.  I have one column in a table that has duplicate values that I want to remove in the Power Query Editor, but there are some duplicates that I need to keep.   The column conta...
  • mattww's avatar
    mattww
    4 years ago

    Sorry if I didn't explain it well

     

    So you would split your query.

     

    Query A = All of your data

    Query B = Reference Query A, filter to only include those starting with #

    Query C = Reference Query A, filter to only include those not starting with #, remove duplicates

    Query D = Append Query B and Query C

     

    The above could all be done in one query via the Advanced Editor, but if you prefer to do it via the GUI, just separate out the queries and to avoid them cluttering up your model, set queries A, B and C to not load (right click the query and untick Enable load)

     

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

     

    Matt