Forum Discussion
DanFromMontreal
4 years agoHelper IV
Add column with the path&filename
Good day, I'm trying to add a column containing the folder & filename for each row of the dataset being imported . I've tried this but does not return want I want.... = Table.AddColumn(#"Sales"...
ImkeF
4 years agoCommunity Champion
Hi DanFromMontreal ,
I think I don't understand the requirement yet:
From your original post:
= Table.AddColumn(#"Sales", "PathAndFilename", each Excel.workbook(file.contents([Folder.path]&[Name])))
are [Folder.path] and [Name] actual columns in your table yet or is that just some M-code that you've tried to return the desired result?
- DanFromMontreal4 years agoHelper IV
ImkeF,
That something I've tried but obviously, did not return what I was expecting. I could be 100% in the left field with what I wrote. Totally beginner.
What I want: The file that I'm importing and transforming with Power Query, I would like my M-code to be able the ADD a column with its filename and path (I.e. C:\Users\DM2088\Downloads\Megalist (20220107).csv) for each of the rows of the dataset.