Forum Discussion
Selecting source files from sharepoint folder
Hi v-piga-msft
I can get the contents of the SharePoint folder in powerQuery, that 's no problem.
I then filter for files whose "source" column (practically the path of the file) does not contain the folder I want to keep. Basically this presents me a list of all files that I want to delete.
The next step is tricky. With a few hundred files filtered, I do a "REMOVE 5000 top rows" to make sure that all files in the filtered files-list are deleted.
this action though deletes all files, including the ones not filtered i.e. the ones I want to keep. Is it clearer now?
thank you
Chronis
Hi Anonymous ,
Sorry, I still a little confused about your sceanrio.
If you want to load the specific files in the SharePoint folder when loading, I'm afraid that we cannot achieve that directly currently in Power BI. We need to load all the files in the Sharepoint folder and then filter the files you need.
I'm not understand your step "REMOVE 5000 top rows", could you explain it ?
Best Regards,
Cherry
- Anonymous7 years agoNot applicable
I have managed to get into power query all the files in the sharepoint directory.
How can I then remove the files I want, but not by selecting one by one, but with a specific criteria.
I can get the list as in your screen shot, but then I can't go selecting files one by one. I use a "contains" filter criteria in the file name.
If I select with the filters the ones I want and then press "Close and Apply" will powerbi import data ONLY from the files I have selected.
if not, how can I delete the files (rows) that are not selected? or, if I select with filters the files I DONT want, how can I delete the selected ones and then remain with the ones that I want.
BR