Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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 4
v-piga-msft
Resident Rockstar
Resident 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.

select files.png

Youalso could delete the files you don't need in query editor like this.

files in sharepoint folder.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not 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

 

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.

filter files.PNG

I'm not understand your step "REMOVE 5000 top rows", could you explain it ?

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-piga-msft 

 

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.