Power Query How to list folder names only NOT files

Joyner

Well-known Member
Joined
Nov 15, 2005
Messages
1,202
Hello, I am fairly new to Power Query and have searched but can't find a solution - every thing I find is related to listing files, not folders. Is it possible for power query to just list folder names from a path? I can list all files with the path and extract the folder name but removing the duplicates with the voluminous files is taking way too long for some reasons, so if I can just list the folder names instead of all files should be much faster.

Thank You
 
Sandy, I wasn't sure how this got added and what it does.

Folder PathLevel
D:\BaseFolder
1​
D:\BaseFolder\Folder1
2​
D:\BaseFolder\Folder2
2​
D:\BaseFolder\Folder2\Folder2.1
3​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.1
4​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.2
4​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.3
4​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.3\Folder2.1.3.1
5​
D:\BaseFolder\Folder2\Folder2.2
3​
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Thanks Sandy, that works, but wish there was a way to automate the hyperlinks with Power Query - maybe next version...
 
Upvote 0

Forum statistics

Threads
1,214,913
Messages
6,122,207
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top