Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
We have a multi-tenant application that uploads reports, changes the datasources, and deploys the single report to the different tenants.
For the import mode, everything works as expected and we are able to use the API to set a refresh schedule.
With the direct query mode, the uploaded report can be manually refreshed in the Power BI Service, however when it is embeded, the query never refreshes and only pulls down what is in the dataset. Here is the flow of getting the report to the server. Keep in mind, the gateways and datasources are manually created, we just attach the correct one at the upload time.
PbiClient created with the ServicePrincipalProfile for the workspace.
Imports.PostImportWithFileInGroup();
PbiClient created as Admin User.
Datasets.TakeOver(groupdId, datasetId); (Admin User required to bind to gateway)
Datasets.UpdateParameters(datasetId, UpdateMashupParametersRequest); (Server and DatabaseName parameters are built with the report in Power BI Desktop)
Datasets.BindToGateway(groupId, datasetId, BindToGatewayRequest); (The request has the correct gatewayId and datasourceId)
Datasets.RefreshDataset(groupId, datasetId, DatasetRefreshRequest);
DatasetRefreshRequest.NotifyOption = NoNotification;
DatasetRefreshRequest.ApplyRefreshPolicy = true; (I have tried omitting this, have not tried setting to false)
DatasetRefreshRequest.Type = Automatic; (I have tried the Full option as well)
DatasetRefreshRequest.EffectiveDate = DateTime.Now;
The refesh request works with the initial upload.
When I embed the report after it has been uploaded, the direct query report never re-runs the query.
I have also attempted to set a refresh schedule for direct query, this always returns Bad Request. I can successfully set a refresh schedule for Import Mode.
Any help would be appreciated.
Solved! Go to Solution.
With the direct query mode, the uploaded report can be manually refreshed in the Power BI Service, however when it is embeded, the query never refreshes
Direct Query and refreshes are incompatible. A Direct Query will run a query against the data source for every user interaction with the report visuals. You cannot refresh a Direct Query data source programmatically.
There is additional complexity here if you have enabled query caching in the dataset settings.
With the direct query mode, the uploaded report can be manually refreshed in the Power BI Service, however when it is embeded, the query never refreshes
Direct Query and refreshes are incompatible. A Direct Query will run a query against the data source for every user interaction with the report visuals. You cannot refresh a Direct Query data source programmatically.
There is additional complexity here if you have enabled query caching in the dataset settings.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |