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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Datasource error (404): Fail to connect sharepoint excel file

Below is the screenshot of the datasoruce error. I have checked the URL is valid but fail to connect to the URL powerbi.

Capture.PNG

1 ACCEPTED SOLUTION

No. Use the SharePoint connector. I do it all the time. If you are going for one file, connect via SharePoint. Then, once the files are listed, change the SharePoint.Files() function in the formula bar to SharePoint.Contents(). (It is case sensitive)

 

then drill down to your file. Power query will open it and show you everything in the file, not just one tab. It will also refresh more reliably in the service. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

5 REPLIES 5
edhans
Super User
Super User

Question - why are you using the Web.Contents function vs connecting to SharePoint via SharePoint.Files or SharePoint.Contents?



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

Because I would like to connect a data to a specific excel file in the sharepoint. I have done a research that if we do so, we should get data from Web.

 

No. Use the SharePoint connector. I do it all the time. If you are going for one file, connect via SharePoint. Then, once the files are listed, change the SharePoint.Files() function in the formula bar to SharePoint.Contents(). (It is case sensitive)

 

then drill down to your file. Power query will open it and show you everything in the file, not just one tab. It will also refresh more reliably in the service. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Russo
Frequent Visitor

I'm using the Web.Contents to conncect to a sharepoint spreadsheet also.  I have a fair amount of applied steps after the source.  What would be the best way to change it to sharepoint connection?

Russo_0-1755114164235.png

 



Make a new connection to the file using SharePoint, then navigate to the file until you have the table of data. Copy that M code and replace all of the M code in your original query up to the point where you are starting to transform the data. You will have to change the table name in that first transformation step to point to the last step from the SharePoint connection.

If you want more help, post some code examples of the first 10 or so lines of both code - your original plus the navigation to the table in SharePoint.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.