Forum Discussion

dylmlee's avatar
dylmlee
Frequent Visitor
3 years ago

New Excel file in folder with new column not importing (cannot change the number of columns in code)

I have loaded data into power query from a folder that has multiple excel files. I have recently updated the last excel file with a new column. The new column does not add into power query. I have looked at changing the number of columns on the query but this is not there. I have also tried to change the number of columns on the sample queries.

 

I was thinking about changing this: Table.ColumnNames(#"Transform File (2)"(#"Sample File (2)"))), to either a new table that has all the columns including the new column or the latest file that includes the new column. Im not sure what syntax to use. 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Does the colum appear further up in the query steps?

    I had a similar issue when using a Table.SelectColumns so it didn't select my new column and replaced it with a Table.RemoveColumns

     

    = Table.SelectColumns(#"Expanded est-pack",{"ItemDesc", "CustCode", "CustItemRef", "MasterEstimateCode", "InventoryQty", "PltQty"})

     

    = Table.RemoveColumns(#"Expanded est-pack",{"ItemCode"})

     

    Although on the face of it the 2 examples above look to give the same results the second will let you keep the new columns added!

     

    Hope that helps.

  • dylmlee's avatar
    dylmlee
    Frequent Visitor

    Thanks all sorted. I went to the sample file and after seeing which file was being referenced I edited the file on my local machine by adding the new column. An easy fix but not the best if anyone else has this issue.