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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MasterSonic
Helper IV
Helper IV

SharePoint excel import

Hi Guys ,

I have working connection with SharePoint to get Excel file based on name and specified sheet name too.

 

I would like tho, to get excel from specific folder.

Irrespectively of name or sheet name it will be the one loaded into model.(file will have 1 sheet only).

 

Could you help me with that please?

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MasterSonic ,

You can refer the following links to get it:

Connecting Sharepoint based excel spreadhseet to power BI


You can change the connection for this report this way, including putting the file on SharePoint.
  1. Put the file in SharePoint. You'll need the URL of the SharePoint site - not to the file, just the site.  So it would be something like https://TenantName.sharepoint.com/sites/SiteName
  2. Use that URL when you connect to SharePoint from in Power BI.
  3. In Power BI, you only need to repeat the steps to get to the "grid of data" - so you'll navigate to or find the file, open it, then open the correct tab.
  4. Now, take that M code and move it to the original code you have, replacing the first 2-3 steps.
  5. Delete the SharePoint connection you created in steps 2/3. You just needed that for the code.

The reason for doing this is the table that Power BI is using cannot be replaced with another table of the same name later. Power BI doesn't use table names internally, it uses numbers, so if "Sales" is table 10, if you remove Sales and replace with a new Sales, it might get an ID of 33, and no measures or visuals will work.

 

This article will help you do it step by step: See this article if you need help using this M code in your model.


How to simply connect Power BI to Excel file stored on SharePoint

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @MasterSonic ,

You can refer the following links to get it:

Connecting Sharepoint based excel spreadhseet to power BI


You can change the connection for this report this way, including putting the file on SharePoint.
  1. Put the file in SharePoint. You'll need the URL of the SharePoint site - not to the file, just the site.  So it would be something like https://TenantName.sharepoint.com/sites/SiteName
  2. Use that URL when you connect to SharePoint from in Power BI.
  3. In Power BI, you only need to repeat the steps to get to the "grid of data" - so you'll navigate to or find the file, open it, then open the correct tab.
  4. Now, take that M code and move it to the original code you have, replacing the first 2-3 steps.
  5. Delete the SharePoint connection you created in steps 2/3. You just needed that for the code.

The reason for doing this is the table that Power BI is using cannot be replaced with another table of the same name later. Power BI doesn't use table names internally, it uses numbers, so if "Sales" is table 10, if you remove Sales and replace with a new Sales, it might get an ID of 33, and no measures or visuals will work.

 

This article will help you do it step by step: See this article if you need help using this M code in your model.


How to simply connect Power BI to Excel file stored on SharePoint

Best Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.