Forum Discussion
Power Query running through each connected file each time new step added
- 3 years ago
Hi Holly454
Sorry for the late reply.
I see, you've used the wizard to combine the files.
Can you please try the old-fashioned way below:
let Source = Folder.Files(REDACTED), #"Removed Other Columns" = Table.SelectColumns(Source,{"Content", "Name"}), #"Added Custom" = Table.AddColumn(#"Removed Other Columns", "CsvDocument", each Csv.Document([Content])), // try to standardize column names like this #"Added CsvDocumentStandardColumns" = Table.AddColumn(#"Added Custom", "CsvDocumentStandardColumns", each Table.RenameColumns([CsvDocument],{ // add below all renames needed for all files {"Columnx", "AnotherColumnName"}, {"ColumnY", "Something"} // ... // below will make sure you get no error case a rename does not apply }, MissingField.Ignore)) in #"Added CsvDocumentStandardColumns"And then Expand...
...and then add all your subsequent steps.
IF/when you notice performance problems, please paste here your new query based on my initial code.
I edited my answer as I saw you have different column names... let's hope this works.
Please mark this as answer if it helped.
- 3 years ago
This worked beautifully - thank you so much!
Hi Holly454
Sorry for the late reply.
I see, you've used the wizard to combine the files.
Can you please try the old-fashioned way below:
let
Source = Folder.Files(REDACTED),
#"Removed Other Columns" = Table.SelectColumns(Source,{"Content", "Name"}),
#"Added Custom" = Table.AddColumn(#"Removed Other Columns", "CsvDocument", each Csv.Document([Content])),
// try to standardize column names like this
#"Added CsvDocumentStandardColumns" = Table.AddColumn(#"Added Custom", "CsvDocumentStandardColumns", each Table.RenameColumns([CsvDocument],{
// add below all renames needed for all files
{"Columnx", "AnotherColumnName"},
{"ColumnY", "Something"}
// ...
// below will make sure you get no error case a rename does not apply
}, MissingField.Ignore))
in
#"Added CsvDocumentStandardColumns"
And then Expand...
...and then add all your subsequent steps.
IF/when you notice performance problems, please paste here your new query based on my initial code.
I edited my answer as I saw you have different column names... let's hope this works.
Please mark this as answer if it helped.