Forum Discussion
Change file path from folder to OneDrive
- 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.
Hi...thanks for your response. This appears to be pointing to a specific xlsx file as a resolution however, I need a resolution that points to a folder that may contain multiple Excel files within that is pulled into BI.
As an example, I have a folder that currently contains 4 Excel files (each represents a different year of data) and I pull the data from that folder into BI as one table, not one specific Excel file.
Thanks for this...I think I'm almost there. However, I have used #"Filtered Rows" elsewhere as an applied step. Is there a way around that? Is it similar to VBA where I could change the instructions you gave me to #"Filtered Rows2"?
- Watsky4 years ago
Solution Sage
Yes you can name differently. Just make sure you change it on the third line as well.