Forum Discussion
Power BI Embedded – DirectQuery visuals not loading in web app
So I have a Power BI report, which I have embedded onto a web app.
The report is built using a composite model: it includes 2 Import-mode datasets (created directly in Power BI Desktop, so one of them is an SQL server data and one is a GA4 Connector) and two DirectQuery semantic models that exist in the same workspace.
I generate an embed token using the https://api.powerbi.com/v1.0/myorg/GenerateToken endpoint and pass all three dataset IDs like this:
The two DirectQuery dataset IDs I found using the /datasets/{id}/datasources endpoint, since those semantic models are published in the workspace. However, I can't find the dataset IDs for the other models (e.g. the Import dataset that was part of the original .pbix file), since they were created directly in Power BI Desktop and don't show up in the workspace datasets list via API. So I just used the composite model ID that I got when I ran the endpoint.
The visuals that are connected to the directquery dataset won't load. They just gave an error "Error fetching data for visual" or "An error occurred due to an on-premise server issue"
As I mentioned, I tried changing the params to provide dataset ids, but I assume I am not doing that correctly. Is there any fix for this?
Hi,
Thank you for the response. So the same error did occur in the workspace, but I fixed by refreshing the credentials/signing in again basically. As for the gateway, my SQL Server import data source has been configured correctly as I am able to access the report in the workspace.
I assume your first suggestion regarding the limitation might be the issue at hand here.
5 Replies
- v-sdhruvCommunity Support
Hi yureed ,
There are certain limitations apply when working with DirectQuery for Power BI semantic models.
‘Using Power BI Embedded with datasets that include a DirectQuery connection to a Power BI datasets or Azure Analysis Services model is not currently supported.’
https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-composite-models#working-with-a-composite-model-based-on-a-semantic-model
But also since you are getting the error, "An error occurred due to an on-premise server issue" hints thatyour SQL Server Import data source or one of the DirectQuery datasets might need a gateway.
Make sure the gateway is:
Installed and configured correctly, Authorized for the dataset and Mapped data sources correctly for DirectQuery sources.
Hope this helps!If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!- yureedRegular Visitor
Hi,
Thank you for the response. So the same error did occur in the workspace, but I fixed by refreshing the credentials/signing in again basically. As for the gateway, my SQL Server import data source has been configured correctly as I am able to access the report in the workspace.
I assume your first suggestion regarding the limitation might be the issue at hand here.