Forum Discussion
Find the mode type in a dataset through the API
Hi TexasBI
Power BI REST API doesn't support you to determine what mode the dataset is in Power BI Service directly.
You could try Datasets - Get Datasources In Group to determind what data source your dataset contains. Find the connection mode the Power BI data sources support to determind.
Here is a post that the user determind whether his dataset is Import or Direct Query by Set All Connections API.
This API only support Direct Query.
For reference: REST API Identification of Import vs Direct Query Datasets
Or you can determind by the refresh way. For example, if your data source support Import/DQ or Import / Live connection, make sure the refresh way, schedule refresh(Import) or schedule cache refresh(DQ or LC).
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey Anonymous ,
Thank you for sending that info. What is interesting is that I have an Azure SQL database and I have created a report using Direct Query mode. When I go to do a GET call in the REST API for datasources, I am returned the same result as if I am on Import mode. This is really strange.
- Anonymous4 years agoNot applicable
Hi TexasBI
Did you call REST API in Power BI Desktop?
What connector did you use to do a GET call in the REST API for datasource?
As my above reply, if you use web connector to call REST API, the connection mode will be Import mode.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- TexasBI4 years agoHelper II
My datasource is an Azure SQL database and I used the Azure SQL connector.