Forum Discussion

deboec's avatar
deboec
Icon for Helper I rankHelper I
5 years ago
Solved

Append 2 tables and remove dublicate rows

Hello guys,

 

I have two queries in my Excel file via connection.

Both queries are connected to tables with an identical structure (columns).

Only some of the rows are different.

 

I want to append query 1 with query 2 and only keep the rows which are unique. 
(So not only removce duplicates but also remove all rows that are not unique).

Query 1 and query 2 both have an index column.

  • Hi deboec ,

     

    Try this:

     

    1. Append the two tables.

    2. Group the appended table based on your requirements and add a "count" column to count rows at the same time.

    3. Only keep the rows which "count"=1.

    4. Expand the table.

     

     

    Best Regards,

    Icey

     

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

3 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Icon for Community Champion rankCommunity Champion

    deboec , you might want to create a blank query

     

    = Table.Distinct(#"query 1" & #"query 2")

     

     

    • deboec's avatar
      deboec
      Icon for Helper I rankHelper I

      CNENFRNL 
      If I use this sintax the blank query basically only appends the two queries.

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi deboec ,

     

    Try this:

     

    1. Append the two tables.

    2. Group the appended table based on your requirements and add a "count" column to count rows at the same time.

    3. Only keep the rows which "count"=1.

    4. Expand the table.

     

     

    Best Regards,

    Icey

     

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