Hi all,
I am importing data from Excel files in a parent folder that has 3 child folders. When I import the data, I'd like to use the child folder names as a field in my imported data. What do I need to do, to achieve this? TIA, Paul
Hi Paul,
Using From File > From Folder and after you choose Transform Data normally you would click on the double down arrow on the content column to combine the files. Instead, you'll notice after clicking Transform Data you have the folder path (among other columns). To retain this, remove all columns except the Folder Path and Content columns, then add a custom column with this formula:
=Excel.Workbook([Content])
From here you can combine the files.
It's the same process as shown in lesson 3.03 of the Power Query course.
Mynda
Thanks Mynda, thanks for that.
Hi Mynda,
That lesson doesn't address my issue - it's looking at multiple sheets, I'm using multiple folders. Whenever I attempt your suggestion, I just get the original data, and no folder. What can you suggest? TIA, Paul
I tested it on my PC. When you follow the steps in that video, one of the columns contains the file path. This file path contains the folder name. All you need to do is keep that column and extract the folder name.