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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

File on ShP site as a data source

Hello All,

I have an issue with adding a file from ShP as a source. I tried with "Excel workbook" source and copying the hyperlink, but I keep getting errors. I tried few other options, but they seem to be not suitable for this case.

Could you please advise how to add such file as data source to PowerBI desktop?

Thank you in advance!

 

qxphm1_0-1689071347073.png

5 REPLIES 5
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

In Power Query, use the SharePoint Folder connector. The URL to enter will be something like this:

https://orgname.sharepoint.com/sites/sitename

 

You can get this URL easily enough by just navigating to the Home page of your SharePoint site and copying the URL from the browser.

It's best to start at this highest level as you then get a table with every file within the site that you can potentially import, and you also only have to store this high-level authentication on your gateway, making reusing the connection for other files in other folders much easier in future.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Thank you for your reply. I tried this method, but unfortunately, I got the following error:

qxphm1_0-1689602367980.png

 

Could you please advise?

 

It looks like you're trying to use the Web.Contents connector to access SharePoint, which is probably why you're getting a 405 error (due to insufficient permissions to access SharePoint via the Web.Contents connector).

As per my previous post, you should be using the SharePoint Folder connector with appropriate authentication. It will generate Source code something like this:

let
    Source =
        SharePoint.Files(
            "https://YourOrgName.sharepoint.com/sites/YourSiteName",
            [ApiVersion = 15]
        )
in
    Source

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Last time I used Sharepoint Folder connector. Today I tried differently just with a new query and I still got 405 error:

qxphm1_0-1689659585614.png

I am wondering - the link to this SharePoint site looks a bit different as it includes "teams" not "sites". It seems that the file was loaded to ShP via Teams group. Does it make any difference? I'm not a member of this Teams group.

 

I also tried to use this method for other ShP site, but instead of the content of one of the files loaded there (which is my goal), I just got a list of all files.

qxphm1_1-1689659933462.png

Am I doing something wrong?

 

 

Teams is based on the SharePoint platform, the same as OneDrive for Business, so any Teams site/channel created gets a SharePoint back-end created to provide a platform for it.

Without being able to see your actual SharePoint it's difficult for me to say whether you're using the correct URL or not, but I've not seen a URL from SharePoint contain 'teams' before, I've only seen it contain 'sites' or 'personal/identifier' (for OneDrive).

If you can access the file location on SharePoint you should be able to access the file via Power Query, providing you use the same credentials and apply them at the correct level i.e. at the '~/sites/YourSiteName' level. The 405 error can also be an indication that you don't have permission to access that URL, so make sure you can access the SharePoint destination first. It may also be the case that you need to be given permissions for the Teams site as well, but I don't recall ever needing this myself.

 

This list of files is just a table, the same as any other, so you can filter it to find the file(s) that you want. Once you've identified the file(s), you can either click the green 'Binary' word in the [Content] column to expand a single file, or hit the two down arrows at the top of that column to combine multiple files.

This is a standard way to connect to SharePoint. It means you only need to authenticate once at the highest level, making the connection highly reusable, and also means that you can select your desired files through logic, making it dynamic too.

 

As alluded to above, I can't really help a lot more without being able to see your SharePoint/Teams setup or understand your permissions level I'm afraid.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.