Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

SharePoint/OneDrive Query Issue: "Invalid credentials" on Service but ok on Desktop

Hi all,


Hoping someone might have some insight or recommendations for our issue. Details below, please help.


We have a recent issue where the dataflows/reports in PBI Service that query data from folders of Excel files on OneDrive/SharePoint are returning errors of "invalid credentials."  


In PBI Serivce, the query can access the source folder and bring in the file records (first 3 steps in image below). 

Capture error 2.PNG


The issue occurs in the 4th step when the query tries to navigate to the specific file. We get the error in the yellow box and then try to "Configure Connection".

Capture error.PNG


The credentials show as anonymous and when we change it to Microsoft Account and OAuth, the error persists. Notably, the Sharepoint address shown in the msg box is not at the folder level, rather, it references the file from the navigation step. (Duno if that is correct or relevant to the issue.)

Capture error 4.PNG


If we copy and paste the exact same query into PBI Desktop, the query returns the Excel file without issue.

Capture error 3.PNG


Thing we've tried:

1. Tried to refresh other reports/dataflows that query other ODB/Sharepoint folders, not just the one shown here, issue persists.

2. Tried to change owner of the dataflow to other colleagues and have them input their credentials and refresh. Issue persists.

3. Tried to create a completely new dataflow and query sharepoint folders and encounter same issue.


Any help is appreciated. Thanks!

Helper III
Helper III








Helper III
Helper III





Helper III
Helper III

Hello @Doodle ,

I have same issue from two weeks. Is you problem solved? 

Can you please share with me the solution in brief please?

Super User
Super User

Use OAuth

Use API 14 instead of 15

Use Sharepoint.Contents() instead of Sharepoint.Files()


Hello @lbendlin ,

If I change api and replace sharepoint.contents(). I received below error.



Clear permissions and reauthenticate.

Thank you very much for quick reply @lbendlin . I sgined out andssigned in back. Do you mean that? If not could you please tell me how to clear permissions in dataflow . I donot see any option here besides to cancel and go back to initial page.

there are a couple of ways to do that but starting over is the fastest, unfortunately.


Is this on-premise sharepoint or sharepoint online?

@lbendlin ,

Its online Sharepoint. 

I tried to create new dataflow and updated API and sharepoint.files(). But I do not see table. there was no change. So I addded Imported csv step in script. 


Now it show this error.



@lbendlin ,

This is the step I am struck.



The screenshot is blurry.

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors