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
admincaleb007
Frequent Visitor

Is there a better way to import CSV data based on a parent folder?

I have a parent folder with all information in it.  This parent folder has 500 folders.  Out of those 500 folders, I need 30.  Out of those 30, I need a specific folder (all the same name) from within that folder.

500 folders:

Z:\Parent.Folder\(500 folders)

I need 30:

Z:\Files\Parent.Folder\(30 folders after filter within power query)

For each of the 30 folders, I need to combine the files within a folder (items in bold are what's required, and underlined is the folder I need):

Z:\Files\Parent.Folder\1stFolder\Public\Source\Files.csv

Z:\Files\Parent.Folder\1stFolder\Public\Destination\Files.csv

Z:\Files\Parent.Folder\1stFolder\Private\Source\Files.csv

Z:\Files\Parent.Folder\1stFolder\Private\Destination\Files.csv

Z:\Files\Parent.Folder\1stFolder\Archive\Source\Files.csv

Z:\Files\Parent.Folder\1stFolder\Archive\Destination\Files.csv

Z:\Files\Parent.Folder\2ndFolder\Public\Source\Files.csv

Z:\Files\Parent.Folder\2ndFolder\Public\Destination\Files.csv

Z:\Files\Parent.Folder\2ndFolder\Private\Source\Files.csv

Z:\Files\Parent.Folder\2ndFolder\Private\Destination\Files.csv

Z:\Files\Parent.Folder\2ndFolder\Archive\Source\Files.csv

Z:\Files\Parent.Folder\2ndFolder\Archive\Destination\Files.csv

etc...

 

Loading 500 folders takes a long time, so I'm trying to avoid that.  Not sure if that is possible, and I can just point to the specific sub-folders I need immediately.

I don't own the files, nor directories, so I cannot reorganize them.

I have tried to make windows shortcuts to the specific paths and use them as the source folder, but that does not work at all.

1 ACCEPTED SOLUTION
admincaleb007
Frequent Visitor

I was able to create some functions with the help of this video:

How to process multiple folders with a single Power Query script - YouTube

It didn't cover my use case 100%, but 60% and I had to do some heavy changes to work for my scenario.  If anyone has an issue/question similar to mine, this video may help.

View solution in original post

1 REPLY 1
admincaleb007
Frequent Visitor

I was able to create some functions with the help of this video:

How to process multiple folders with a single Power Query script - YouTube

It didn't cover my use case 100%, but 60% and I had to do some heavy changes to work for my scenario.  If anyone has an issue/question similar to mine, this video may help.

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