Forum Discussion
sql query against imported table in semantic model
- 1 year ago
Hi Anonymous ,
The short answer is no, you can't query model data using SQL within Power BI Desktop. PBI models use the tabular structure and are optimised for DAX and MDX queries.
However, depending on your use-case, you may be able leverage Datamarts, but you've not provided enough information to understand whether this is feasible/appropriate or not:
https://learn.microsoft.com/en-us/power-bi/transform-model/datamarts/datamarts-analyze
Pete
- 1 year ago
No, you cannot run SQL queries directly on imported data in Power BI’s semantic model. Instead:
- Use DAX queries (via DAX Studio or Analyze in Excel) for querying.
- Use SQL in Power Query before importing data.
- In DirectQuery mode, write SQL queries to retrieve data from the source.
- For Pro/Premium, use XMLA endpoints for external querying.
- Use DAX queries (via DAX Studio or Analyze in Excel) for querying.
Hi Anonymous ,
The short answer is no, you can't query model data using SQL within Power BI Desktop. PBI models use the tabular structure and are optimised for DAX and MDX queries.
However, depending on your use-case, you may be able leverage Datamarts, but you've not provided enough information to understand whether this is feasible/appropriate or not:
https://learn.microsoft.com/en-us/power-bi/transform-model/datamarts/datamarts-analyze
Pete