Forum Discussion
Unable to get data from sharepoint folder
When ever i try to get data from a sharepoint folder. i put in the URL and i get an error "An exception occurred: We experienced an error when trying to access the data gateway:". how can i fix this an get data from a sharepoint folder. I have managed to do so on the deskop app but i need to do it on the web app. When i upload the desktop app model i cannot access the sharepoint files getting this error "We experienced an error when trying to access the data gateway: ."
Help would be much appreciated thanks
This Issue was caused my me orginally creating the model on desktop and then uploading it to power bi online which for some reason prevented it from importing any new data at all. kept getting the same error if i tried to link it to a one drive file and would give the error when i would upload an excel file to it
The issue was fixed by me just recreating the model on power bi as that allow me to import data from any source
Thanks for the help
6 Replies
- ZanquetaSuper User
Hi noahrivett
This error occurs because the Power BI Service cannot directly access SharePoint files without a properly configured gateway or cloud connection, even if it works in Power BI Desktop. When you publish a report that uses a SharePoint Folder connector, the service needs credentials and a data source configuration to refresh or access the files.
If these are missing or misconfigured, you see the error:
“We experienced an error when trying to access the data gateway.”Confirm SharePoint type
- If your SharePoint is SharePoint Online (Microsoft 365):
- No gateway is needed.
- Go to Power BI Service → Settings → Datasets → Data source credentials.
- Set authentication method to OAuth2 and sign in with your organisational account.
Use the correct connector
- In Desktop, use SharePoint Folder or SharePoint Online List with the full site URL:
https://yourtenant.sharepoint.com/sites/yoursite
Best Practice
- For SharePoint Online, always use OAuth2 authentication.
- For large folders, filter in Power Query early to avoid performance issues.
If this answer was helpful in any way, I would be pleased to receive a 👍, as well as the satisfaction of seeing a DAX measure work for the first time without needing yet another FILTER.
Please mark it as the accepted solution. This helps other community members find the quickest path and saves them from another endless loop 🌀.- noahrivettFrequent Visitor
Thanks for the reply,
This solution doesnt work, the authentification method was already set to OAuth2 and so i still get the same error
- tayloramySuper User
Hi noahrivett,
Are you connecting to SharePoint Online, or an on prem installation of SharePoint?
If you're connecting to SPO, a gateway isn't needed and will only complicate things.Are you able to share with us the settings of the connection itself? In the rop right, click onthe settings gear and click "Manage connections and gateways" and from there you should be able to find it.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
- MohdZaid_Super User
Hey noahrivett ,
I ran into the same issue when trying to connect a SharePoint folder in Power BI Service after everything worked fine in Power BI Desktop. The root cause was that the web service requires a proper cloud connection, not a gateway connection, for SharePoint sources.
Here’s what fixed it for me:
Use “SharePoint Folder” with the site root only
In Power BI Service, create a new data source and enter only the site URL, e.g.:
https://yourcompany.sharepoint.com/sites/YourSite
Do not paste the full library/folder path.Set the authentication method correctly
Choose:
OAuth2 → Organizational Account → Sign In
(Anything else will trigger the gateway error.)Remove the gateway mapping
SharePoint Online does not need a gateway.
Go to Manage Gateways → remove any mapping to this dataset so Power BI doesn’t try to use the data gateway.Refresh credentials in the dataset
Dataset → Settings → Data Source Credentials → Re-enter with OAuth2.
After doing this, Power BI Service connected instantly and the dataset refreshed without errors. The key insight was that the service always tries to use cloud credentials for SharePoint, and forcing a gateway will break the connection every time.
- noahrivettFrequent Visitor
This Issue was caused my me orginally creating the model on desktop and then uploading it to power bi online which for some reason prevented it from importing any new data at all. kept getting the same error if i tried to link it to a one drive file and would give the error when i would upload an excel file to it
The issue was fixed by me just recreating the model on power bi as that allow me to import data from any source
Thanks for the help