Forum Discussion
Scheduled Refresh Issue with Value.NativeQuery
- 8 years ago
I got notification from MS Support that the issue has been fixed in the service. I confirmed it works as the dataset now shows the refresh features (without requiring a republish) and an ondemand refresh works.
GilbertQ Yes, using the inline query method does work for simple queries, but will require us to "stringify" the queries that have parameters. I would like to avoid that since I believe the intent of Value.NativeQuery is to allow parameterization. Thank you for the workaround suggestion, though.
I did speak with MS yesterday and they are researching. I was able to recreate the issue on a different Azure SQL Database server and in a fresh report.
It does seem like something changed on the service side. This only affects models that are republished. Existing reports on the service with the same types of queries are working fine. Needless to say, we are hesitant to publish any updates to other reports until this is resolved. We are having to resort to manual data refreshes in desktop and then publishing manually.
Just a quick question how did you connect to your data in order to create the Value.NativeQuery from Get Data?
- bdunzweiler8 years ago
Helper I
GilbertQ Here's a simplified version of what triggers the issue
let Source = Sql.Database("my-azure-server", "my-db"), query = Value.NativeQuery(Source, "select * from dbo.DateDetail where CalendarYear >= @someYear", [someYear=SomeReportParam) in queryThe issue triggers even if the parameters are removed.
- GilbertQ8 years ago
Super User
hi bdunzweiler
Thanks for that I did not know you could do it that way.
This is the way I have done it in the past.My Parameter is called "Start Date"
let Source = Sql.Database("my-azure-server", "my-db", [Query=" Select * from dbo.DateDetail where CalendarYear >= "& #"Start Date" &" ",CreateNavigationProperties=false]) in Source- bdunzweiler8 years ago
Helper I
FYI, MS identified this as a new issue as suspected. It is on the https://powerbi.microsoft.com/en-us/support/ page
Some Users may fail to refresh settings after recently publishing models that use Native Query to fetch data.users may be able to avoid this issue by avoiding using Native Query during GetData, Avoid pasting Structured Query Language (SQL) queries, use stored procedures, Allow Power Query to create your query in Power BI Desktop. Engineers have found the issue and are working on a fix. Next update @ 04/11/2018 11:30 PM UTC