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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Extract Excel workbook filename

Hi everyone. First post with a new account.

 

I'm trying to extract the filename of an Excel workbook in Power Query and place into a column. Feels like this should be possible, as it's there in the 'Name' field of the Source data.

 

To expand a little more .. I have mutiple workbooks, all in the same format, that I'd like to import and merge into one table. Before I merge them, I need a way of labelling each query so I now which is which.

 

Thanks for reading.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

I believe that you don't wnat to merge but append all workbooks, the best option is to use the From Folder option that creates a list of all your files in the folder and a function for you to use a file as a demo to make the treatment of the data, when you finalize the treatement you will have a column wiht the name of the file that you can then delete or keep.

 

https://docs.microsoft.com/en-us/power-bi/desktop-combine-binaries


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Anonymous ,

 

I believe that you don't wnat to merge but append all workbooks, the best option is to use the From Folder option that creates a list of all your files in the folder and a function for you to use a file as a demo to make the treatment of the data, when you finalize the treatement you will have a column wiht the name of the file that you can then delete or keep.

 

https://docs.microsoft.com/en-us/power-bi/desktop-combine-binaries


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi, thanks for that.

 

Initially that didn't work but it was because the sheets in each workbook had different names. It brings the data in now.

 

Is it possible to apply the same tranformations to each workbook before they are combined?

 

Cheers

Hi @Anonymous ,

 

The concept behind this way of treat the data is exactly that, to have one file as standard transofrmation and all of the transformation will be applied to all files.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.