Forum Discussion

Roym's avatar
Roym
Helper IV
4 years ago
Solved

Refresh data from onedrive

I build a report in PBI desktop with the source Excel on my ondrive for business. When publishing the report to the cloud the report is working. But once I try to refresh the dataset I get this error 'Scheduled refresh is disabled because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources. Then reactivate scheduled refresh.'.

 

What I found out is that in PBI desktop the source takes my c://.... and not the onedrive url directly. So most likely that is the problem. But I'm not sure how to change this without recreating my whole report. I tested to do get data on the PBI cloud and then make the connection to the onedrive and then the refresh works. Hopefully anyone has an idea on how to fix this without re-creating my whole report again 🙂 Thanks!

6 Replies

  • Hello - behind the scenes, OneDrive is a Sharepoint document library, so you can use the Sharepoint connector.  This is how I retrieve the content from an Excel that I saved in OneDrive but access through Sharepoint.

     

    Note, the query steps below are parameterized for each updating and reproduction.

    The object_type is the Excel file object (Table, Sheet, etc).  The object name is is the name of the object selected in object type.  In this example I am wanting the content of a Table named InputData in an Excel file named (file name specified in input_file_name), which is saved in my OneDrive for Business folder.

     

      Source = SharePoint.Files(sp_site, [ApiVersion = 15]),
      get_file = Table.SelectRows(Source, each [Name] = input_file_name),
      Navigation = get_file{0}[Content],
      file_content = Excel.Workbook(Navigation, null, true),
      get_object = Table.SelectRows(file_content, each [Kind] = input_object_type and [Name] = input_object_name),
      object_content = get_object{0}[Data],

     

    • Roym's avatar
      Roym
      Helper IV

      jennratten Sorry, i'm not fully understanding it (yet). In my PBIX file I have two tables that come from Excel. Currently for both those tables when I go into the query editor the source is:

       

      = Excel.Workbook(File.Contents("C:\Users\name\OneDrive - company.com\PowerBI\Report V3.xlsx"), null, true)

       

      How do I need to adjust this?