Forum Discussion

sgupta22's avatar
sgupta22
Icon for Helper II rankHelper II
3 years ago
Solved

Refresh in PowerBI Service not working due to dynamic data source (File.Contents)

I have a Power BI report that uses a dynamic data source through the File.Contents.  I understand that dynamic data sources do not get refreshed from Power BI Service but one can use the RelativePath parameter.  However, this didn't work for me and I get the following error message: 

 

 

 

 

Would be great if someone knows if there is a solution to this problem.

 

Cheers

Shashank

 

Ashish_Mathur 

  •  

     

    Source = Excel.Workbook(File.Contents(Text.Combine({"H:\My Drive\Work\HFA\HFA - ",Company,".xlsm"})),null, true)

     

     

    There are a couple of things problematic here:

    - File connector - not sustainable. Use a folder connector and then filter by your desired filename

    - H: drive data source location.  This will not work in the service unless you use a Personal Gateway that requires your PC to be on when the refresh is scheduled. - not sustainable.  Use a folder in the cloud, ideally a sharepoint/onedrive folder

    - .xlsm file  - this may or may not work depending on other factors. Definitely better than .xls or .xlsb, but the preferred extension is .xlsx

     

8 Replies

    • sgupta22's avatar
      sgupta22
      Icon for Helper II rankHelper II

      Thanks for your reply Ibendlin.

       

      Is there a similar workaround for File.Contents? Or is it simply not possible to have a data refresh through PowerBI service when a dynamic data source is being used in File.Contents?

       

      Regards

      Shashank

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Accessing files via File.Contents is considered bad practice. Use the Folder connector or - better yet - the Sharepoint Folder connector.  That takes care of the RelativePath part automatically.