This repo contains a C# extractor for Power BI/Fabric semantic models under src/SemanticModelExtractor.
It connects to the workspace XMLA endpoint with TOM, exports semantic model definitions to JSON, and also queries $SYSTEM.DISCOVER_CALC_DEPENDENCY so you can trace how measures are built from other measures, calculated columns, and base columns.
See RUNNING.md for the publish-safe setup and authentication instructions, including:
- Microsoft browser SSO
- User principal authentication
- Service principal authentication
- Workspace and semantic model parameter examples
The JSON contains:
- Tables and regular columns
- Measures and DAX expressions
- Calculated columns and DAX expressions
- Calculated tables through
CalculatedPartitionSource - Power Query/M partition expressions
- Calculation groups and calculation items
- Relationships
- Calculation dependency DMV rows
For quick local inspection:
jq '.tables[].measures[] | select(.name == "Gross Turnover Rate")' exports/sales-semantic-model.json
jq '.calculationDependencies.rows[] | select(.OBJECT == "Gross Turnover Rate" or .REFERENCED_OBJECT == "Gross Turnover Rate")' exports/sales-semantic-model.jsonAvoid committing exported metadata if it contains sensitive model logic or source queries. The exports/ folder is ignored by git.