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 September 15. Request your voucher.

Reply
DJL
Regular Visitor

Combine files from different folders + Add a column with file path

Hi all,

 

I have a scenario where a monthly CSV dataset is generated from a system.  For audit purposes, this dataset is then stored into a corresponding monthly folder on SharePoint, eg: Jan 2022, Feb 2022, Mar 2022 and so on.  This data underpins various reporting products and an objective is to automate pulling the latest months' data into a Power BI report.

 

The file name is always the same, let's call it 'Audit Dataset'.  So, I tested out a technique which involves searching for that string in the File Name field, to filter down.  This works well in identifying the file across multiple folders - so I'm half way there 🙂  However, I need to be able to differentiate time periods and for that, pull in the folder name 'ie: Mar 2022' and have that as a column within the appended dataset.

 

But I can't see a way to reference the source file path and align that as a new column.  If I could do that, I'd simply just trim the end of it to create my Reporting Month column - voila, job done.

 

Any thoughts / help most appreciated...

 

Thanks 🙂

1 ACCEPTED SOLUTION
mussaenda
Super User
Super User

Hi @DJL,

 

of course you can do that.

If you are pulling data using Folder instead of single file,

You can see these applied steps:

mussaenda_0-1649495766313.png

 

then on the removed other columns,

select also the folder path so it will not be removed.

 

mussaenda_1-1649495867984.png

 

viola, job done.

 

hope this helps.

 

View solution in original post

2 REPLIES 2
mussaenda
Super User
Super User

Hi @DJL,

 

of course you can do that.

If you are pulling data using Folder instead of single file,

You can see these applied steps:

mussaenda_0-1649495766313.png

 

then on the removed other columns,

select also the folder path so it will not be removed.

 

mussaenda_1-1649495867984.png

 

viola, job done.

 

hope this helps.

 

Hi Mussaenda,

 

That's brilliant - works a charm!

 

Thanks for the help, very much appreciated 😎

 

DJL

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors