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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
campelliann
Post Patron
Post Patron

Source Problem in a shared file - Power query

Hi,


I have an excel file which I share with my team on teams/sharepoint. I have no problems refreshing the queries but my colleagues do. All the data comes from a share folder, I made a sync from teams/sharepoint of the source files to my computer, so in the source file path in power query you can see my C:\users\my name\ my enterprise name etc. 

How I can I get around this?  Here is the the error my colleagues met: "DataSource not found file or folder". I assume I must change the source without mention my c:?

 

campelliann_1-1597240951246.png

 

 

1 ACCEPTED SOLUTION
edhans
Super User
Super User

You need to reconnect to the file using the SharePoint link, not the C drive link. I am assuming you have sync'd that to your PC. Your co-workers have a different path if they are syncing it.

 

Go to the sharepoint site and get the site address. It will be something like:

https://tenantname.sharepoint.com/sites/sharepointsitename

You'll get a source in your M code that will look like SharePoint.Files(). If you have just a few files, less than 1,000 or so, that is fine. If you have a lot in that site, change it to SharePoint.Contents() - note it is case sensitive.

No matter which you use, you can filter to fined the file if using SharePoint.Files, or drill down using SharePoint.Contents().

Once you get the file loaded, you can go into the advanced editor and copy all of that code to your existing query replacing the Source and naviation lines.

 

If you need help, post back with your code, or see the link below which will assist with swapping out source and transformation data in M code. 

 

See this article if you need help using this M code in your model. 



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

3 REPLIES 3
edhans
Super User
Super User

You need to reconnect to the file using the SharePoint link, not the C drive link. I am assuming you have sync'd that to your PC. Your co-workers have a different path if they are syncing it.

 

Go to the sharepoint site and get the site address. It will be something like:

https://tenantname.sharepoint.com/sites/sharepointsitename

You'll get a source in your M code that will look like SharePoint.Files(). If you have just a few files, less than 1,000 or so, that is fine. If you have a lot in that site, change it to SharePoint.Contents() - note it is case sensitive.

No matter which you use, you can filter to fined the file if using SharePoint.Files, or drill down using SharePoint.Contents().

Once you get the file loaded, you can go into the advanced editor and copy all of that code to your existing query replacing the Source and naviation lines.

 

If you need help, post back with your code, or see the link below which will assist with swapping out source and transformation data in M code. 

 

See this article if you need help using this M code in your model. 



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

can you make a video showing how to do it

camargos88
Community Champion
Community Champion

Hi @campelliann ,

 

You should use the sharepoint file address to avoid more problems.

This address "C:\users\my name\.." is local in your computer.

Also even it's shared you need to input the source with the server in the path.

 

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors