Forum Discussion

coolshib's avatar
coolshib
Icon for Helper III rankHelper III
8 years ago
Solved

How to change source data from local drive to One Drive

Hi Everyone, I have a report which i published from my Power BI desktop app. My Source data is stored on my local drive. I have uploaded all my source data to my one drive and now i want to link my...
  • OwenAuger's avatar
    8 years ago

    Hi coolshib

     

    I am assuming your source files are Excel files.

     

    You will have to do two things:

    1. Find the appropriate URL pointing to your file on OneDrive
      If it's OneDrive for Business look here
      If it's OneDrive Personal see this post
    2. Change the step of your query that connects to the file from something like this
      =Excel.Workbook(File.Contents("C:\dummy\file.xlsx"),null,true)
      to something like this (OneDrive for Business)
      =Excel.Workbook(Web.Contents("https://XXXXX-my.sharepoint.com/personal/USER_XXXXX_onmicrosoft_com/Documents/folder/file.xlsx"),null,true)
      or something like this (OneDrive Personal)
      = Excel.Workbook(Web.Contents("https://onedrive.live.com/download?resid=XXXXXXX&authkey=YYYYYYYYYYY&em=x&app=Excel"), null, true)

    The appropriate credentials would be needed for either connection.

     

    Does that help?

     

    Regards,

    Owen