Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mikesdunbar
Helper I
Helper I

Custom column with source file name

I'm trying to make a column that lists  the source file name. In this case, I've imported an Excel file named FileName.xlsx. I don't know if there's someway I can just write some Power Query formula that will return a column with each line saying FileName. I've read dozens of messages about creating folder sources, Merging from SharePoint, that sort of thing. 

I feel like there's got to be a simple way to do it.

 

The reason I ask is that I'm putting together a monthly financial report, and the Excel file's name has the month and year in it. So, when someone opens it, I could make a card which lists that file name.

 

Thank you! 

1 ACCEPTED SOLUTION
mickey64
Super User
Super User

For your reference.

 

Step 0: I use these datafiles below.

           These files are in the 'DATAFOLDER' folder.

202410_DATAFILE.xlsx

mickey64_0-1734005991426.png

202411_DATAFILE.xlsx

mickey64_1-1734006033792.png

 

Step 1: I click 'Get data' icon and select 'Folder' and click 'Connect' button  on Power BI Desktop.

mickey64_2-1734006090016.png

 

Step 2: I click 'Browse...' Button and select 'DATAFOLDER' folder and click 'OK' button.

mickey64_3-1734006318988.png

 

Step 3: I select 'Combine & Transform Data' menu.

mickey64_4-1734006432367.png

 

Step 4: I select 'Sheet1' and click 'OK' button.

mickey64_5-1734006584170.png

 

Step 5: I can get 'Source.Name' column automatically.

mickey64_6-1734006651936.png

 

View solution in original post

2 REPLIES 2
mickey64
Super User
Super User

For your reference.

 

Step 0: I use these datafiles below.

           These files are in the 'DATAFOLDER' folder.

202410_DATAFILE.xlsx

mickey64_0-1734005991426.png

202411_DATAFILE.xlsx

mickey64_1-1734006033792.png

 

Step 1: I click 'Get data' icon and select 'Folder' and click 'Connect' button  on Power BI Desktop.

mickey64_2-1734006090016.png

 

Step 2: I click 'Browse...' Button and select 'DATAFOLDER' folder and click 'OK' button.

mickey64_3-1734006318988.png

 

Step 3: I select 'Combine & Transform Data' menu.

mickey64_4-1734006432367.png

 

Step 4: I select 'Sheet1' and click 'OK' button.

mickey64_5-1734006584170.png

 

Step 5: I can get 'Source.Name' column automatically.

mickey64_6-1734006651936.png

 

lbendlin
Super User
Super User

Use the Folder (or SharePoint Folder)  connector. Then you get the filename column for free.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors