Forum Discussion
How to import files from different paths
Hi ImkeF would you be able to provide any more detail on this solution, I'm struggling to follow it with my basic knowledge of Power Query...
I can create a table called Filepaths with a column header called Filepaths but I'm not sure where I create the custom column or if the ColumnNameContainingPaths would be Filepaths or something else. Any assistance gratefully received.
Cheers
K.
Hi KWilkinson02 ,
please start with importing just 1 file via the "From Excel-Method". Then check the M-code that has been generated. In the following steps you will replace the path to that file with the reference to a column. So the way that path has been written needs to match one of the columns from your solution.
Please check out this blogpost, which describes the general method (although it is for multiple webpages, the general princple is the same): https://www.thebiccountant.com/2018/02/10/web-scraping-1-combining-multiple-tables-from-one-page-in-power-bi-and-power-query/
- KWilkinson026 years agoHelper I
Thanks a lot ImkeF , I will work through that now.
- KWilkinson026 years agoHelper I
Sorry ImkeF still struggling. I can see how to add in the custom column and create the named table okay but the formula in your previous posts keeps telling me the field of the record wasn't found... If you have time to help a little further I would be very grateful. This is what I have;
My table named 'Filepath' (I'm hoping these images expand!!) which contains my file paths as a single column called Column1
I've then created a custom column as per your code suggestion replacing column name with 'Column1' and table name with 'Filepath' however I just get an error telling me Column1 doesn't exist.
I'm also not clear how I then use that to actually grab the files...
Sorry if I'm being a bit thick here, this is the only post I can find that even remotely provides a solution to what I'm trying to achieve...
- KWilkinson026 years agoHelper I
After a bit more fiddling with this, I think I see what I'm trying to do at least.
The Source = Excel.Workbook(FileContents ... line needs to point to the list of file paths that are defined in my table. What I'm not understanding is why I need to create a custom column and why that doesn't work...
I'm definitely trying to run before I can walk here but I really need to find a solution to this now or it will haunt me!