Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I am new to PowerBI/Power Query and was trying to solve this problem.
I have a folder of files that contain data, but these files do not contain a column that indicates what product it is for. What I'm trying to do is add a column with the file name and the combine all of the files so that I have one table.
I.E, my files are located in c:\files and are named:
I need to add a column to each file that says "Product1", for example, so that the product can be distinguised after the files are combined. Ideally this would be able to be automated so that the new files are dropped in and then refreshed.
Could someone get me started? I searched for similar threads and I ended up getting lost trying to recreate the steps.
Thanks
Check out this recent blog post from Gil Raviv on PowerPivotPro.com
https://www.powerpivotpro.com/2016/12/import-csv-files-folder-filenames-power-bi/
Bhavesh,
I tried it and it works, but I can't export the rows due to data limit. So I really need to do this in Power Query as the end users need the data in a pivoted excel file.
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 75 | |
| 36 | |
| 31 | |
| 29 | |
| 26 |