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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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