Forum Discussion
Add Excel Data Source with Additional Columns
- 5 years ago
You can see the M code in the Advanced Editor in Power Query (right click on any query, click "Advanced Editor". If you used the official merge option there will be a new section with a ingestion function and a sample file reference. Walk through the generated code, and find the place where it mentions the sample file (for the headers). Usually it is the first file in your list.
That may actually give you an in. When you list the items in the sharepoint folder, sort them in a way that newer files come first. Then the merge code will pick up the new structure (and gracefully merge the older files even if they are missing the new column).
Hi lbendlin, I'm pulling data from named tables. The table name is the same in all the Excel files. I do need the new columns, so I can't ignore them.
I'm not sure how to see the merge code. My applied steps are:
1. Identify the source: a SharePoint site address
2. Filtered Rows to pick the Excel files to be included in the merged query (including the new Excel file)
After this step, I would typically use the "Combine Files" function in the Content column. However, if I do that now, I believe it will corrupt the transform steps added after #2. By including the new file in #2, I am able to pull in the new Excel file, but not the new columns.