Forum Discussion

thechad13's avatar
thechad13
Helper I
4 years ago
Solved

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...
  • Watsky's avatar
    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. 

     

    1. Start by uploading your file to OneDrive. 
    2. Once uploaded open the OneDrive file so that it loads into Excel
    3. In Excel, click File, then Info. You should see an option for Copy path. Click it.
    4. 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
    5. Open your Power BI report and go to Power Query.
    6. For the data source you're trying to change click on the Source Applied step.  
    7. 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 

       

    8. 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
    9. 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.