Forum Discussion
Automatic Refresh not working when connecting to SharePoint Online file
- Anonymous7 years ago
shampayne,
Based on your description, you want to configure OneDrive refresh for your dataset. And you want to get updated data in Power BI report when you change data in Excel source within one hour.
In this case, you would need to directly connect to the SharePoint online Excel file in Power BI Service using Get Data->Files->SharePoint option. Then create report in Power BI Service and configure OneDrive Refresh for the dataset.
Regards,
Lydia - 7 years ago
Thank you for the responses. This is truly helping understand the capabilities and limitations of this very valuable feature.
I have done some initial tests based on the feedback from this thread and have gotten it to work successfully in some scenarios.
Scenario 1 (working)
File Configuration
- Created an Excel spreadsheet in Excel Online. Saved to a Sharepoint document library. *NOTE* This spreadsheet MUST be formatted as a table to work.
- Created a PowerBI Report directly in the PowerBI Service website
- Clicking My Workspace > +Create in the top right corner > Report > Import New Data > Files > Get > Sharepoint - Team Sites > Paste in Sharepoint URL > Connect > Load the newly created spreadsheet that's saved in the Sharepoint document library
PowerBI Setup
- After loading in the above, I created a handful of visualizations in the Dataset and the saved as a new report
- Checking the Schedule Refresh option of the Dataset shows that OneDrive refresh is enabled. Note that Scheduled Refresh was not an option
Testing
- Went back to the Excel spreadsheet that is saved on Sharepoint Online and added some random data using Excel Online
- Checked the report about an hour later on the PowerBI Service website and saw that it accurately reflected the changes that were made to the spreadsheet on Sharepoint Online
Scenario 2 (not working)
I did basically the same thing as Scenario 1 only created the PowerBI Report using PowerBI desktop as opposed to PowerBI Service website. I used the exact same Spreadsheet as Scenario 1 saved in the same Sharepoint Online location as Scenario 1. Saved the PBXI desktop file to the same Sharepoint Online document library as where the spreadsheet is located. Then imported the PBXI desktop file to the PowerBI Service using Get Data option. This shows that OneDrive refresh is enabled but it will not pick up the changes when the Excel file is changed in Excel Online while Scenario 1 does. Checking the refresh history shows that the Dataset in this scenario has not been refreshed.
TLDR; It appears that when a report is created using PowerBI desktop, automatic refresh does not work even though PowerBI Service shows that OneDrive refresh is configured correctly and enabled. Everything works if the report is created using PowerBI Service (which is not an option for many of us).
I suspect the issue is because you chose to make use of Web Link. I've ran afoul of this issue before. There are multiple ways to achieve access to items in SharePoint Online and OneDrive. Unfortunately that "success" can come with unintended consequences. In this case, because you have used web, the refresh wants a gateway.
What we need to do is alter your query such that it going to OneDrive directly and can make use of the direct connection functionality. This won't cause you to lose any of your work, as we just need to tweak the "Source" line of your import query.
Onedrive acts like a SharePoint online folder. So you can actually just use the SharePoint Online Folder connector. Unlike other places, you don't need to use the full URL, just enough to get to your specific folder. Next we use navigation steps to get to your file.
Source = SharePoint.Files("https://YOURCOMPANY.sharepoint.com/personal/FULL_NAME_COMPANY_com/", [ApiVersion = 15])
If you use a Source line that looks like that, all you need to do is locate your files name in the name column. It doesn't matter if its in a sub folder. Next click on the yellow word "Binary" on that row, now from here it should act just like any other excel file.
Good morning and thank you for the suggestions.
I had previously tried using the Sharepoint Folder connector exactly as you mentioned and it has been unsuccessful. It works fine for scheduled refresh and manual refresh, but it will not automatically refresh as outlined in the Microsoft doc when the spreadsheet changes.
The web link is also configured correctly for a Sharepoint Online file. The PowerBI service is not asking for a gateway as this is also working fine for scheduled refresh and manual refresh.
Thanks
- Anonymous7 years agoNot applicable
What do you mean by automatic refresh? Scheduled refresh is the automated refresh option for an import dataset. Are you talking about direct query?
- Anonymous7 years agoNot applicable
Ok i'm wrong here. I've ignored the CSV on one-drive option:
https://docs.microsoft.com/en-us/power-bi/refresh-csv-file-onedrive