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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.