Forum Discussion
Power BI Report Server Data Sources and Scheduled Refresh
I profiled the query from the server in SQL Profiler and found the underlying table - the datasources were set to DirectQuery, even though they are definitely set as Import on the model in Power BI Desktop.
I manually altered them to Import and I can now change the datasources, but on the Scheduled Refresh it is still saying that there are DirectQuery sources and it can't be refreshed.
SELECT *
FROM DataModelDataSource
WHERE ItemId = '9BB99F05-962A-4672-B5CC-33421417BB0D'
--UPDATE DataModelDataSource
--SET DSType = 'Import'
--WHERE ItemId = '9BB99F05-962A-4672-B5CC-33421417BB0D'
So, there was one more reference in the Catalog properties for <HasDirectQuery>True</HasDirectQuery> that I had to change.
I have no idea why the model is so persistent in thinking it has DirectQuery. Zero, none, nada, zilch of the queries point to a data source with Direct Query. They're all Import. I've re-created them all.
I wonder if there's something in the model that if it ever has a DirectQuery that it's always flagged as DirectQuery. I would love if anyone with some knowledge could explain this to me. If there is some magical flag on the model in Power BI Desktop that I've completely overlooked, then I'd love to know about it. I would super love to never have to go thru this again.
- AndrewTobin6 years agoFrequent Visitor
So, while that seems to solve it temporarily - even if you download the file back from the server the next time you upload it again it switches back to DirectQuery.
Am I just doing this completely wrong? I really need this to refresh and short of re-developing a huge solution from scratch again, I can't think of anything to do. And there's no guarantee that would solve it either.
- robertjordanmmc6 years agoFrequent Visitor
Here is how I was able to resolve this issue:
export Report as [reportName].pbit (can use .pbix as well, just smaller)
rename [reportName].pbit to [reportName].zip
extract all
edit "DataModelSchema" with notepad
update "defaultMode": "directQuery", to "defaultMode": "import",
Highlight all files, Right Click-> Send to -> Compressed (zipped) folder
rename resulting zip to [reportName].pbit
Now when it is deployed, it no longer has any issues. Re-downloading should now reflect the fix.