cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

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 data source from local drive to One Drive in Power BI Services without hamperring the existing reports and Dashbords.

 

Please advice on this.

 

Thanks in advance.

 

Kind Regards

Shibsankar Ghosh.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

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


Owen Auger

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

Connect on Twitter
Connect on LinkedIn

View solution in original post

2 REPLIES 2
Super User I
Super User I

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


Owen Auger

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

Connect on Twitter
Connect on LinkedIn

View solution in original post

Thank you so much Owen Auger.

Much Appreciated.

Best Regards

Shib

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors