Forum Discussion

Frankllina's avatar
Frankllina
New Member
6 months ago
Solved

How to audit datasets in a workspace for Native SQL usage vs direct table connection

Hi all, I’m trying to build a control dashboard that shows, for each semantic model (dataset) published in a workspace, how many data sources / queries use native SQL (e.g., Value.NativeQuery or sim...
  • rohit1991's avatar
    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.