Power query - import files from folder then change the transform sample and recompile the files query

bark01

Board Regular
Joined
Sep 6, 2006
Messages
135
Office Version
  1. 365
Platform
  1. Windows
I'm importing a number of CSV files that are stored in a folder.

I can get power query to import and merge them all into a long list, however if i make changes in the power query editor - > Transform Sample file. The Data query that combines all the files no longer works as I've changed the header in the sample row. i.e. the data query is looking for column 1 but i have changed the transform sample file so the first row is now the header row, its not the default column 1, 2 etc.

The changes i'm making are the original files contain a file description on row1 then the actual header on row 2. So i want to delete the first row. I then want to do a full transpose to switch columns with rows and then make the new first row the header. Having done this everything looks fine in the sample. but I can't get the combine query to run as its looking for column 1 which no longer exists. Is there a way to make power query recompile teh combine query based on the new sample file?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Answerd my own query. you can refer to column by its numeric postion 0 = the first column

#"Renamed Columns3" = Table.RenameColumns(#"Changed Type1",{{Table.ColumnNames(#"Changed Type1"){0}, "Source"}}),
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top