Forum Discussion
thechad13
4 years agoHelper I
Change file path from folder to OneDrive
Greetings all, I have a BI project that currently loads data from file folders (containing Excel files) into Power Query tables. The challenge is that I am am the only person that can access/upd...
- 4 years ago
Hiya thechad13 , there is a way to change the path but really it's more like changing your Source applied step in Power Query as it's more than just the path that has to change.
- Start by uploading your file to OneDrive.
- Once uploaded open the OneDrive file so that it loads into Excel
- In Excel, click File, then Info. You should see an option for Copy path. Click it.
- You'll give a path that looks something like this... https://companyname-my.sharepoint.com/personal/username/Documents/Filename.xlsx?web=1. Paste the link somewhere then remove ?web=1 part. So it'll look something like this https://companyname-my.sharepoint.com/personal/username/Documents/Filename.xlsx
- Open your Power BI report and go to Power Query.
- For the data source you're trying to change click on the Source Applied step.
- As a side step if you do not see the Formula Bar then click View at the to of your Power BI then check the option for Formula Bar
- In your Formula bar your Source will look something like this =Excel.Workbook(File.Contents("C:\Users\username\Downloads\FileName.xlsx"), null, true). Change File.Contents to Web.Contents.
- Change the local path to the copied OneDrive path from earlier (make sure to keep it within double quotes). It should look something like this... =Excel.Workbook(Web.Contents("https://companyname-my.sharepoint.com/personal/username/Documents/Filename.xlsx"), null, true)
That will change the source path from your local file to OneDrive.
Watsky
4 years agoSolution Sage
Hiya thechad13 , there is a way to change the path but really it's more like changing your Source applied step in Power Query as it's more than just the path that has to change.
- Start by uploading your file to OneDrive.
- Once uploaded open the OneDrive file so that it loads into Excel
- In Excel, click File, then Info. You should see an option for Copy path. Click it.
- You'll give a path that looks something like this... https://companyname-my.sharepoint.com/personal/username/Documents/Filename.xlsx?web=1. Paste the link somewhere then remove ?web=1 part. So it'll look something like this https://companyname-my.sharepoint.com/personal/username/Documents/Filename.xlsx
- Open your Power BI report and go to Power Query.
- For the data source you're trying to change click on the Source Applied step.
- As a side step if you do not see the Formula Bar then click View at the to of your Power BI then check the option for Formula Bar
- In your Formula bar your Source will look something like this =Excel.Workbook(File.Contents("C:\Users\username\Downloads\FileName.xlsx"), null, true). Change File.Contents to Web.Contents.
- Change the local path to the copied OneDrive path from earlier (make sure to keep it within double quotes). It should look something like this... =Excel.Workbook(Web.Contents("https://companyname-my.sharepoint.com/personal/username/Documents/Filename.xlsx"), null, true)
That will change the source path from your local file to OneDrive.