Power Query - Column added in source

Copper Contributor

Hi,

 

I am using Power Query to merge monthly files (extracted monthly from our costumer system) into a single table in Excel. 

 

This month a new column have been added in the extracted file, that did not exist before and when I update the data for the Power Query question the new column is not included. Could anyone please tell me how to get the new column included in the Excel table.

 

I use Get data and From folder. The file format is CSV.

 

Thank you in advance!

 

Katarina

3 Replies

@ACIKB 

The easiest way is to add one more column into sample file (very first one), just only header is enough. Or make not blank any cell in this column if you have no headers (zero or "").

And it's better to remove Change Type step in main query since it hardcodes column names.

@ACIKB 

I had a similar problem to yours: many new columns in the CSV files in the folder where data is coming  from though the old columns also existed with the same names as before: To resolve it, I changed the value for the Columns parameter (from 18 to 39 in my case) as shown in the screenshot below.

 

apaksoy_0-1698450261676.png

 

I got a warning message as I applied this change but ignored it. Not sure if related but now the query using this data includes the original sample file which does not exist any more within the list for its source (can't remove it) but the missing file does not seem to affect how the query operates or its outcome. I also had to make some changes to the rest of the query so that the new columns are processed correctly.

 

P.S. I closed and then opened the Excel file with the PQ routine mentioned above and refreshed the queries once more. The reference to the original sample file has disappeared from the source list for the query mentioned above and everything seems to be continuing to work fine as well.

@apaksoy 

 

Your mention of changing the number of columns in the advanced editor section worked well for me. I overlooked that part of the code several times. Thank you for sharing your knowledge!