Forum Discussion
How to audit datasets in a workspace for Native SQL usage vs direct table connection
- 6 months ago
Hii Frankllina
Power BI Service does not expose Power Query (M) code, so you cannot directly audit Native SQL vs direct table connections from a workspace UI. The only accurate method is to use the XMLA endpoint (Premium/PPU required) or REST API + Tabular Object Model (TOM) to extract each dataset’s M expressions (partitions/data sources) and programmatically scan for patterns like Value.NativeQuery or hard-coded SQL. If the M code shows direct navigation (e.g., Sql.Database(...){[Schema=...,Item=...]}), it’s direct table/view access. There is no built-in report in Power BI Service that provides this classification.
Hii Frankllina
Power BI Service does not expose Power Query (M) code, so you cannot directly audit Native SQL vs direct table connections from a workspace UI. The only accurate method is to use the XMLA endpoint (Premium/PPU required) or REST API + Tabular Object Model (TOM) to extract each dataset’s M expressions (partitions/data sources) and programmatically scan for patterns like Value.NativeQuery or hard-coded SQL. If the M code shows direct navigation (e.g., Sql.Database(...){[Schema=...,Item=...]}), it’s direct table/view access. There is no built-in report in Power BI Service that provides this classification.