Changing Power Query Transforms, without destroying previous previous

Copper Contributor

Setup a Folder Power Query with transforms for a daily downloaded .csv report. It works well, but now we need to add a new column to the downloaded report. I can easily define new transforms for the extra column, but won't this be a problem for previously imported .csv data?

 

How can I update the transform for the new column of data without messing up the previous data?

2 Replies

In theory if it's just an additional column it may not be a problem

 

You may need to change the Sample file to the new file number temporarily (or easier option is to name the new file something that forces it to appear 1st alphabetically just while you're fixing up the Transform Sample file step)

 

 

image.png

 

 

 

Also, you may need to change the column number in the source step of the Transform sample file

image.png

 

Hope that helps

 

Wyn

MVP

Australia UTC+ 8

 

If this answer was the best response please click the button

I also happily accept likes

 

@spectrl 

As variant in addition to Wyn's suggestion, in Sample File not to select concrete file, but on previous step before selecting first in the list, sort table in descending order on date of modification, thus the latest file will be taken as the sample.

 

However, from my point of view most reliable is to keep in the folder the file as 0000.xlsx with only one row of column names, and modify it more columns are added.

 

With that

1) In Transform Sample File query with formula on Source step change Columns=<some number you have> on Columns=null and add one more step to Promote First Row as Header. Remove automatically generated after it step with type change.

2) In main query remove last Changed Type step (most probably it'll be an error on it) and add step to filter 00000.xlsx file.