| name | power-bi-diagnostics |
| description | Troubleshoot Power BI model performance, trace query execution, manage caches, and verify the pbi-cli environment using pbi-cli. Invoke this skill whenever the user says "pbi not working", "setup issues", "connection failed", "slow query", "performance", "profiling", "tracing", "health check", "model audit", "pbi setup", or encounters any pbi-cli error. This is the first skill to check when something goes wrong with pbi-cli. |
| tools | pbi-cli |
Power BI Diagnostics Skill
Troubleshoot performance, trace queries, and verify the pbi-cli environment.
Prerequisites
pipx install pbi-cli-tool
pbi-cli skills install
pbi connect
Environment Check
pbi setup
pbi setup --info
pbi --json setup --info
pbi --version
Quick Troubleshooting
If pbi-cli isn't working, run these checks in order:
pbi --version
pbi setup --info
pbi connect
pbi connections last
pbi dax execute "EVALUATE ROW(\"test\", 1)"
Model Health Check
pbi --json model get
pbi --json model stats
pbi --json table list
Query Tracing
Capture diagnostic events during DAX query execution:
pbi trace start
pbi dax execute "EVALUATE SUMMARIZECOLUMNS(Products[Category], \"Total\", SUM(Sales[Amount]))"
pbi trace stop
pbi --json trace fetch
pbi trace export ./trace-output.json
Cache Management
pbi dax clear-cache
Connection Diagnostics
pbi connections list
pbi --json connections list
pbi connections last
pbi connect -d localhost:54321
pbi disconnect
Workflow: Profile a Slow Query
pbi dax clear-cache
pbi trace start
pbi dax execute "EVALUATE SUMMARIZECOLUMNS(Products[Category], \"Total\", SUM(Sales[Amount]))" --timeout 300
pbi trace stop
pbi trace export ./slow-query-trace.json
pbi --json trace fetch
Workflow: Model Health Audit
pbi --json model get
pbi --json model stats
pbi --json table list
pbi --json relationship list
pbi --json security-role list
pbi database export-tmdl ./audit-export/
Best Practices
- Clear cache before benchmarking:
pbi dax clear-cache
- Use
--timeout for long-running queries to avoid premature cancellation
- Export traces to files for sharing with teammates
- Run
pbi setup --info first when troubleshooting environment issues
- Use
--json output for automated monitoring scripts
- Use
pbi repl for interactive debugging sessions with persistent connection
Gotchas
pbi connect succeeds even against a stale port: Desktop reassigns its local Analysis Services port on every restart. Connection from the previous session may bind to a port now occupied by a different model — queries return data from the wrong file. After Desktop restart, always pbi connect again rather than reusing the saved connection.
pbi setup --info reports pythonnet status, not runtime health: A green pythonnet: ok line means the DLL loaded — it does NOT verify the AdomdClient can talk to your model. Confirm with a smoke query like EVALUATE ROW("test", 1) before assuming the environment is healthy.
- Trace events arrive asynchronously:
pbi trace fetch immediately after trace stop may return an empty list. Wait 1-2 seconds or call fetch in a short retry loop — events buffer in the AS server before flushing.
- Clearing formula engine cache leaves storage engine cache intact: Repeat-running a benchmark query after
clear-cache still hits cached VertiPaq segments. For a true cold benchmark, restart Desktop or reconnect.
model stats counts hidden objects too: Calculation groups, auto-date hierarchies, and translation tables inflate the table count vs. what a user sees in the field list. Cross-check with table list filtered on visibility.
--timeout is in seconds, not milliseconds: Easy slip — --timeout 300 is 5 minutes, not 0.3 seconds. Default is 60s, which silently kills any moderately-complex query on a cold cache.