Forum Discussion
Selecting source files from sharepoint folder
Hi
I want to import files from a sharepoint site. I am connecting to the site, all well, and I'm presented with a huge list of files.
I know that the files that I want to import are the ones in the <target_directory> folder.
I can filter the desired files using a filter in the folder path column but how do I direct PowerBi to only import the selected files. Or the other way round, delete the non selected files.
thank you
BR
Chronis
4 Replies
- v-piga-msftResident Rockstar
Hi Anonymous ,
Which connector do you use when you get data from SharePoint Folder in Power BI Desktop.
By my tests, you could get data via SharePoint folder connector in Power BI Desktop and then you could combine or edit the files like below.
Youalso could delete the files you don't need in query editor like this.
Best Regards,
Cherry
- AnonymousNot applicable
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
- v-piga-msftResident Rockstar
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