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

Web.Contents credentials problem

I an running a function to import data from Excel spreadsheets.  It begins with something like

 

     Excel.Workbook(Web.Contents(pathName))

 

with the pathName being passed as a parameter such as "https://spo.domain.com/sites/long_path_name/file_name.xlsx"

 

So far, so good.  It's working fine in PowerBI desktop but when trying to use it in a Dataflow I get the error message of "One or More tables references a dynamic data source".  Fair enough, I've modified the above to 

 

     Excel.Workbook(Web.Contents("https://spo.domain.com",[RelativePath="sites/long_path_name/file_name.xlsx"]))

 

The only problem is that using the latter doesn't allow me to authentificate using my normal credentials.  For some reason, using

 

     Excel.Workbook(Web.Contents("https://spo.domain.com/sites/long_path_name/file_name.xlsx"))

 

works fine, but using 

 

     Excel.Workbook(Web.Contents("https://spo.domain.com/",[RelativePath="sites/long_path_name/file_name.xlsx"]))

 

Does not work.  What am I missing?

3 REPLIES 3
lbendlin
Super User
Super User

You are missing the part where they told you to never use a Web connector for Excel files on a Sharepoint. Use the "SharePoint Folders"  conenctor instead.

Anonymous
Not applicable

That doesn't solve the problem.

It does, bceause now it is properly handling OAUTH authentication.

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.

Top Solution Authors