Forum Discussion
Dee
Helper III
5 years agoStore file name as column value on power query
I'm importing data from different sources, excel and csv, I'm looking for a way to add a column that specifies the name of the source file. eg. DataSource 1 of type excel has the field animal name a...
PhilipTreacy
Super User
5 years agoHI Dee
If you use load the file(s) using Get Data -> From Folder, then filter for the file(s) you want, you'll end up with a column showing the filename, for example
let
Source = Folder.Files("d:\temp"),
#"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "data.xlsx"))
in
#"Filtered Rows"
Gives me this
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Dee
Helper III
5 years ago