Forum Discussion
skurek
7 years agoNew Member
How to import files from different paths
Hi. How to import files from different locations? I have paths to files saved in Excel table. I can import one path from Excel to PQ: = Folder.Files(paths{0}[Column1]) but this method gets only ...
Greg_Deckler
7 years agoCommunity Champion
You could create a separate query for each file, or simply create multiple "Source" lines. Either way, just append all of them together in the end. Not sure I can be more specific. ImkeF might have some thoughts as well.
let
Source = Csv.Document(File.Contents("C:\temp\powerbi\jobid.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
Source1 = Csv.Document(File.Contents("C:\temp\powerbi\months.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"JobID", Int64.Type}, {"Date", type date}}),
#"Appended Query" = Table.Combine({Source, Source1})
in
#"Appended Query"ImkeF
7 years agoCommunity Champion
You can start from a table with one pathname in each row. Then you have to convert your From-Path-query into a function and apply it in a custom column. Just expand the columsn afterwards.