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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Rosy081
Frequent Visitor

Power BI

My credentials are not working for one of the datasource in power bi.
I only have access to the excel file in a sharepoint folder but do not have access to the root directory. 
How can I add this data source or how can I make it working?

10 REPLIES 10
v-nmadadi-msft
Community Support
Community Support

Hi @Rosy081 ,
We are following up once again regarding your query. Could you please confirm whether you have raised ideas forum with Microsoft?

If the issue has been resolved, we kindly request you to share the resolution or key insights here to help others in the community. If we don’t hear back, we’ll go ahead and close this thread.

Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.

 

Thank you for your understanding and participation.

v-nmadadi-msft
Community Support
Community Support

Hi @Rosy081 ,
As your requirement is unique and the potential workarounds failed to meet your requirement then I would suggest to share a suggestion in ideas forum with the specific feature that you require Fabric Ideas - Microsoft Fabric Community, where the product team actively monitors user feedback. Ideas with strong community support are more likely to be considered for future implementation. Posting there helps ensure your request reaches the right audience and contributes to shaping the product roadmap.

Thank you

DaleHohmTmp
Frequent Visitor

The OP will probably not be able to use this method due to permission restrictions on the SharePoint Document Library and probably would be able to use my original method - I do see the potential for issues however.

DaleHohmTmp
Frequent Visitor

OK, so I was starting to gather data to debate this issue with you, but decided to ask CoPilot first.  I'm amazed I can ask such a generic question of CoPilot and get such a targeted answer.  The suggested code uses the SharePoint.Files connector AND allows the specific filespec without tedius filtering.  So, I'm humbled.

 

Q: In Power Query, if I open an excel file in a SharePoint document library like this: Excel.Workbook(Web.Contents("https://xxx.sharepoint.com/sites/yyy/zzz/myFile.xlsx"), null, true), will it eventually lead to errors?

 

A: When you use

Excel.Workbook(Web.Contents("https://xxx.sharepoint.com/sites/yyy/zzz/myFile.xlsx"), null, true)

you’re effectively telling Power Query to pull the binary content of the file directly using a generic web call, then parse it as an Excel workbook. Initially, that might work fine, but over time there are several potential pitfalls:

  1. Caching & Stale Data: Power Query’s Web.Contents function implements caching based on the URL and any query parameters. If the file is updated on SharePoint but the URL remains the same, Power Query might still return a cached version. This isn’t just a matter of stale data—it can cause errors if the cached version doesn’t match the file’s current structure.

  2. Authentication & Permissions: SharePoint has its own nuances around authentication and authorization. The dedicated SharePoint connectors (like SharePoint.Files or SharePoint.Contents) handle these matters much more gracefully. When you bypass these connectors, you might run into intermittent authentication issues—especially if your organizational policies or tokens change.

  3. Structural Changes & Metadata: The Excel.Workbook function expects a certain format. If the file is modified (even slightly) on SharePoint—say, a sheet is renamed or headers change—the direct binary parsing might start throwing errors. With the dedicated SharePoint connectors, you generally get more metadata and context that helps Power Query adapt to changes.

  4. Refresh and Query Folding Issues: Using Web.Contents in this way may interfere with some query folding capabilities and scheduled refreshes. This could lead to inconsistencies or errors later, particularly if the file’s source or permissions are updated.

Best Practice Advice: For files stored in SharePoint, it’s wiser to use the built-in SharePoint connectors. For instance, using something like:

let
    Source = SharePoint.Files("https://xxx.sharepoint.com/sites/yyy", [ApiVersion = 15]),
    MyFile = Source{[Name="myFile.xlsx"]}[Content],
    Workbook = Excel.Workbook(MyFile, null, true)
in Workbook

This method leverages the SharePoint.Files connector, which is designed to handle the quirks of SharePoint access, such as authentication, caching updates, and file metadata. It makes the data source more robust to changes over time.

Conclusion: Yes, while your approach may initially work, it can eventually lead to errors due to caching, authentication, and file change issues. Switching to a dedicated SharePoint connector method is more reliable, especially if you expect the file to change or if you need consistent refresh behavior.

 

v-nmadadi-msft
Community Support
Community Support

Hi @Rosy081 ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Thanks and regards

v-nmadadi-msft
Community Support
Community Support

Hi @Rosy081 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thanks and regards

v-nmadadi-msft
Community Support
Community Support

Hi @Rosy081 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-nmadadi-msft
Community Support
Community Support

Hi @Rosy081  ,
Thanks for reaching out to the Microsoft fabric community forum.
If you are trying to connect to an Excel which is in a  Sharepoint, make sure you are using web connector and providing the link over there

vnmadadimsft_0-1739781709553.png

 


Reference document: Use OneDrive for work or school links in Power BI Desktop - Power BI | Microsoft Learn

If you are still encountering the issue even after doing the above mentioned step and encountering “access denied due to organizational policies” please refer to this troubleshooting document which will help you in resolving it: SharePoint Online or OneDrive for Business access denied due to organizational policies error messag... 

I hope my suggestions point you in the right direction to resolve your issue.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS.
Thanks and Regards

If you are trying to connect to an Excel which is in a  Sharepoint, make sure you are using web connector 

Please do not recommend that. The correct way is to use the SharePoint Folder connector.

lbendlin
Super User
Super User

This scenario may not be covered by the connector.  You may try the Graph API calls but that may not work either.

 

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors