Reputation: 191
I inherited a monstrous Excel spreadsheet that had more VLOOKUP and range references than I could have imagined were possible, and analysts were tired of copying and pasting into it. Power Query to the rescue!
My question was:
Can Power Query load data into an existing table?
Power Query loads data into a new table upon creation of a query, and this would break a lot of the downstream connections that I don't have the bandwidth to recreate. I was only able to find a solution to this issue in a Reddit thread; sharing it here for posterity.
Upvotes: 1
Views: 5270
Reputation: 191
Assuming all references to the Table are in the same workbook,
mytable
into a new workbook (sometimes the sheet and all is easiest),mytable
to OLDmytable
.mytable
. Ensure that ALL the columns are the exact same name as the original table!
Now, in your new workbook, there is a power query loaded/owned table with the same name as the original: mytable
.
Your original workbook has references to this new workbook and the mytable
- it doesn't know that this is actually a different table (now being filled by PQ) to the original.
You should now open the original workbook and PROVE that all references to the original Table now point to this new Table.
If there are #REF errors - you have got some column names wrong! Close the original again without saving and fix in the new workbook/query
Once everything appears correct, with both workbooks open, move the sheet/table back to the original workbook (the Power Query will follow it to the original workbook, and appear as connection only in the new workbook)
Upvotes: 1