Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 and the name of the file is Test 1.xlsx, DataSource 2 has the same format but of type csv.
Desired output.
Name SourceName
Cat Test1.xlsx
Dog Test1.xlsx
Cat Test.csv
I would like this to be updated on each import.
Any help on how to achieve this would be highly appreciated
Ah. that wasn't mentioned in your initial question.
Proud to be a Super User!
HI @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.
Proud to be a Super User!
I am getting data from a web source.
Web API specifically on powerapps power query.
This is possible. You start with your table of filenames and folderpaths, then you can concatenate those into into a custom column, either using a function or an if then else that use Excel.Workbook or CSV.Document depending on file type. It would be easier to have one query that gets all your CSVs (potentially two separate queries, one for each Folder), and another that gets all your Excel files (or two). You can then make sure the column names match and append them all together. You can then uncheck Enable Load on all but the final appended table.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
63 | |
53 | |
39 | |
25 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |