Forum Discussion
Need help combining two worksheets
- 5 months ago
Merge and Append can be done pretty easily through the PQ UI.
For Merge, you just need to make sure your Unique ID's truly match...same type and same string.
For Append, you ideally want both tables to have columns that match. They don't need to match perfectly, but it starts getting a little weird with how columns get ordered if there aren't a perfect match.
You can Merge or Append into an existing query, or create a new one.
I recommend creating a new one, and then changing the queries that are the source of the Merge/Append to a Connection Only that isn't actually loaded.
Hi Rnaval,
You can try a pattern like this.
This assumes you have two tables in 1 excel workbook, the first table is called _t1 and the second (the table to append to the first) is called _t2. Both these tables have at least 1 column called IP address
let
t1 = Excel.CurrentWorkbook(){[Name="_t1"]}[Content],
t2 = Excel.CurrentWorkbook(){[Name="_t2"]}[Content],
r = Table.Combine(
{
t1,
Table.RemoveMatchingRows(t2, Table.ToRecords(t1), {"IP address"})
}
)
in
r
Or simply append both tables and remove duplicates from the IP address column...
I hope this is helpful