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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Philipp_ISARTAX
Frequent Visitor

How to get a criteria in a column based on the filename of the data source

We are preparing a statistic where all paricipants provide a xlsx-table in the same format and structure. The table itself does not include a value for the providing participant. 

The identification of the participant is only possible according to a participant-Code which is part of the xlsx-filename.

 

What I have done so far:

I have copied all files in one folder and imported the data with Power Query from the folder as source. 

After that I combined all tables to get one table with all data. 

Now I want to add a column which gives me the filename from which xlsx-File the data comes or which shows the code which is included in the filename.

Otherwise I'm actually not able to analyse the data based on the participants.

 

I hope I have described my issue propperly.

 

Kind regards,

Philipp 

1 ACCEPTED SOLUTION
Jonvoge
Solution Supplier
Solution Supplier

Hi Philipp

 

If you are using a Folder connection, you can use the Combine Files option to create a query which will include the file name for you to use:

Jonvoge_0-1714116529365.png

 

Jonvoge_1-1714116538280.png

 

Even if your files should not be combined, you can simply filter down your query to only include one file at a time, before using the Combine button to only expand that single file.

_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Find me on LinkedIn, Sessionize, or my blog Downhill Data

 

View solution in original post

2 REPLIES 2
Jonvoge
Solution Supplier
Solution Supplier

Hi Philipp

 

If you are using a Folder connection, you can use the Combine Files option to create a query which will include the file name for you to use:

Jonvoge_0-1714116529365.png

 

Jonvoge_1-1714116538280.png

 

Even if your files should not be combined, you can simply filter down your query to only include one file at a time, before using the Combine button to only expand that single file.

_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Find me on LinkedIn, Sessionize, or my blog Downhill Data

 

Hello Jon,

Thank you very much for your support. This helped already a lot!

 

Is there also a possibility to include the Folder Path as column in the table? 

Background is, that the connected folder has some subfolders which I would like to identify.

 

Many thanks in advance

Kind regards,

Philipp

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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