| name | power-bi-docs |
| description | Auto-document Power BI semantic models by extracting metadata, generating documentation, and cataloging all model objects using pbi-cli. Invoke this skill whenever the user says "document this model", "what's in this model", "list everything", "data dictionary", "model inventory", "audit contents", "catalog", "describe the model", or wants to understand what objects exist in a semantic model. |
| tools | pbi-cli |
Power BI Documentation Skill
Generate comprehensive documentation for Power BI semantic models.
Prerequisites
pipx install pbi-cli-tool
pbi-cli skills install
pbi connect
Quick Model Overview
pbi --json model get
pbi --json model stats
Catalog All Objects
pbi --json table list
pbi --json table get Sales
pbi --json table schema Sales
pbi --json measure list
pbi --json measure get "Total Revenue" --table Sales
pbi --json column list --table Sales
pbi --json column list --table Products
pbi --json relationship list
pbi --json security-role list
pbi --json hierarchy list --table Date
pbi --json calc-group list
pbi --json perspective list
pbi --json expression list
pbi --json partition list --table Sales
pbi --json calendar list
Export Full Model as TMDL
pbi database export-tmdl ./model-docs/
This creates a human-readable text representation of the entire model.
Workflow: Generate Model Documentation
Run these commands to gather all information needed for documentation:
pbi --json model get > model-meta.json
pbi --json model stats > model-stats.json
pbi --json table list > tables.json
pbi --json measure list > measures.json
pbi --json relationship list > relationships.json
pbi --json security-role list > security-roles.json
pbi --json column list --table Sales > columns-sales.json
pbi --json column list --table Products > columns-products.json
pbi database export-tmdl ./tmdl-export/
Then assemble these JSON files into markdown or HTML documentation.
Workflow: Data Dictionary
For each table, extract columns and their types:
pbi --json table schema Sales
pbi --json table schema Products
pbi --json table schema Calendar
Workflow: Measure Catalog
Create a complete measure inventory:
pbi --json measure list
pbi database export-tmdl ./tmdl-export/
Culture Management
For multi-language models:
pbi --json advanced culture list
pbi advanced culture create "fr-FR"
pbi advanced culture delete "fr-FR"
Best Practices
- Always use
--json flag for machine-readable output
- Export TMDL alongside JSON for complete documentation
- Run documentation generation as part of CI/CD pipeline
- Keep documentation in version control alongside TMDL exports
- Include relationship diagrams (generate from
pbi --json relationship list)
- Document measure business logic, not just DAX expressions
- Tag measures by business domain using display folders
Gotchas
measure list returns DAX expressions but not display formatting: Format strings, display folders, and descriptions live on separate properties. To capture a complete measure inventory always pair --json measure list with a TMDL export — the JSON view alone misses metadata that authors care about.
table schema ignores calculated columns at the schema level: They show up in column list but table schema reports only the storage-engine schema. Documenting a model from schema alone makes calculated columns invisible.
relationship list does not report inactive relationships' purpose: isActive: false shows up but the reason (USERELATIONSHIP usage, role-playing dimension) lives in the measures that reference them. Grep USERELATIONSHIP across the TMDL export to find the consumers.
- Snapshotting
--json outputs to files captures connection-time state: If someone edits the model between commands, your "documentation" mixes pre- and post-edit state. Wrap multi-command catalog runs in a single pbi transaction begin or do them after pbi disconnect / connect on a known model.
advanced culture list shows cultures, not which strings are translated: A culture row in the list does not mean every label has a translation. Diff the per-culture string tables in the TMDL export to find gaps.
expression list includes both shared parameters and full M queries: Both render as named expressions in the output. A parameter is just a single-line literal expression — easy to misclassify when generating a "data sources" section of docs.