QT:DAX: Speed Up This Report
Find the slow chart. Fix the DAX. Prove the numbers didn't change.
Point QT:DAX at a slow Power BI report. The native workflow:
- times supported chart DAX and shows measured bottlenecks;
- finds the DAX and model size behind them;
- lets your AI agent write the fix on a separate copy;
- compares planned chart queries and affected measures on saved data, retaining missing contexts and failures;
- times the charts again;
- prepares a separate workbook and before/after evidence for your review.
Version 1.1.1 is a release candidate. Exact-package native acceptance, saved-copy
reload, extension-host and fresh-profile acceptance must pass before it is treated
as a qualified release. A successful source test or engine comparison alone does
not establish those outcomes.
Windows x64 · PBIP or import PBIX · Runs on your machine · Your original is never changed
Why not just let your agent hack at it?
Claude, Copilot or Codex can rewrite DAX in seconds. What they can't do by themselves is tell you whether the rewrite is right, whether it's faster, or which chart was slow in the first place. Optimised DAX that's wrong is the worst outcome: totals, blanks and filter context can change silently, and nobody notices until a number in a board pack is off.
|
Your agent alone |
Your agent with QT:DAX |
| What to fix |
Guesses from the DAX it reads |
Ranks measured chart queries, with the measures and columns behind them; unsupported queries remain visible |
| Are the numbers still right? |
"Looks equivalent" |
Runs the planned chart queries and affected measures on the original and changed models; differences block acceptance, and missing contexts remain visible. |
| Is it faster? |
"Should be faster" |
Times the same chart queries before and after, and shows the speed-up per chart |
| Model size |
Rarely looked at |
Measures the largest columns (bytes, distinct values), which slow charts read them, relationships, data types, auto date tables and calculated objects |
| Your file |
Edits it directly |
Works on a separate copy. Your original stays byte-for-byte unchanged, and delivery keeps a recovery copy with one-command rollback |
| What you can show others |
A chat transcript |
A report: what was slow, what changed, the answers that were checked, and before/after timings |
QT:DAX doesn't replace your agent. Your agent does the thinking and writes the change. QT:DAX gives it the evidence and checks the result.
Example
A Contoso multi-currency sales report with two slow matrix charts. The agent removed a per-row context transition from two sales measures and dropped an unused high-cardinality text column.
| Chart |
Before |
After |
| "Demo with dates" matrix |
16.5 s |
2.7 s |
| "Demo" matrix |
21.6 s |
9.1 s |
- Timed with Performance Analyzer in Power BI Desktop. The table shows the median of refreshes two and three; all three refreshes per chart, before and after, are retained (12 observations).
- Answer check: 110 of 110 finite comparisons matched: 108 unfiltered measure checks and two rebuilt report queries. Thirty comparisons returned BLANK on both models. These checks do not cover every slicer or filter combination or establish that the exact Performance Analyzer queries were compared.
- Column data: 2.9 MB smaller.
How to use it
- Install this extension. Run QueryTorque: Get Started to open the walkthrough, then QueryTorque: Install QT:DAX CLI. It installs the engine from the bundled, hash-checked packages, with no download.
- Run QueryTorque: Help Me Fix This Slow Report and choose your report: a PBIP folder, or an import PBIX. A PBIX is copied to a separate PBIP; your file is left alone. A workbench opens in your browser while QT:DAX prepares the run. Power BI can stay closed.
- Ask your agent to follow the generated
AGENT.md. This works with Claude Code, Codex or VS Code chat. The guide walks it through five steps:
native-measure: time supported chart DAX and rank the slow ones. Add --desktop to use Power BI Desktop's own Performance Analyzer.
- Write
change-plan.json: the DAX changes, and any columns to remove (only with your approval).
native-plan-trial: compare the planned chart queries and affected measures on both models. Inspect the tested contexts, missing coverage and fresh saved-copy checks before accepting the copy.
native-measure --trial-root: time the same charts on the changed copy.
native-deliver once its evidence gates pass and you approve delivery to the prepared working copy named in AGENT.md. native-rollback restores that working copy from its recovery receipt; the source report remains unchanged.
- Review the workbench:
- slowest charts first;
- before/after per chart, with "Same answers" next to each;
- size and model problems, with what each one costs.
Prefer direct controls? After preparation, use Measure Original Chart DAX,
Test Native Change Plan on Copy, then Measure Candidate Chart DAX from the
Command Palette or the QT:DAX view menu. The plan picker previews the measure and
column changes before testing. Open Native Investigation Workbench returns to
the retained results. These controls measure chart DAX on a private native engine;
your original stays unchanged and delivery remains a separate decision.
Headless by default. QT:DAX times supported chart DAX on its own private engine, with no Power BI window. These are engine timings for the tested queries and saved data. The time people see in Power BI also depends on their machine, cache and page. Use --desktop for a separate Performance Analyzer measurement. Review its coverage and failures before interpreting it as report response.
Matching results are finite evidence, not general DAX equivalence. Refresh,
security roles, omitted filters and untested interactions remain outside the
comparison. A model copy must also pass its fresh saved-copy reload checks;
matching results in a running engine do not prove the saved project reopens.
Requirements
- Windows x64 and VS Code 1.95 or later.
- CPython 3.12 (x64) already installed: from python.org,
py or uv. QT:DAX creates its own private environment and doesn't touch your other packages.
- Power BI Desktop (x64) for native runs.
- A report saved as PBIP with its local
.pbi/cache.abf, or an import-mode PBIX. DirectQuery and remote models aren't supported in this workflow.
- The first native run downloads Microsoft's Analysis Services client libraries once, pinned by hash, from the official NuGet feed.
Privacy and safety
- QT:DAX sends no report telemetry. Native preparation downloads Microsoft's client libraries once; configured AI providers and your agent have their own network and data-handling behavior.
- Your agent only sees what you choose to give it, under your agent provider's terms.
- The original report is never edited. Every change goes to a separate copy first.
- Nothing is deleted without your approval. Column removal needs a named approver.
- Restricted Mode and virtual workspaces disable the extension.
Not affiliated with Microsoft. Power BI is a trademark of Microsoft.
Working with agents
Configure Agents (MCP) writes the MCP setup for Claude Code (.mcp.json) and VS Code (.vscode/mcp.json). It also opens a snippet for Codex's config.toml, which you paste in yourself. Existing entries are preserved.
Copilot agent mode can call the qtdax_* tools:
- workbook overview, bottlenecks and visual profile;
- measure forest, model statistics and rule catalogue;
- explanation and context preparation;
- candidate comparison and sweep status.
Applying a change is deliberately not an agent tool: you approve delivery.
Chat: @qtdax /sweep, /explain <visual-id>, /fix <bottleneck-id>.
FAQ
Does it upload my workbook? No. Everything runs locally. Only what you choose to share with your agent leaves your machine.
Why does it block a change when most answers match? One wrong number in one filter context is enough to break trust in a report. Every difference is listed so your agent can fix it and try again.
Why not trust the agent's own test? An agent that writes the change and then grades it is checking its own homework. QT:DAX runs the comparison independently, on the real engine, against the original model.
Will my users see exactly the same speed-up? Timings describe the tested queries, cache state, data and machine. Report load time also depends on rendering and interactions. Use --desktop for separate Performance Analyzer timings.
Setup failed? Run Run Workbook Doctor. It shows what's missing (Python, Power BI Desktop, client libraries) and offers the fix.
Licence? QT:DAX is open source under the Apache License 2.0 (the LICENSE file is included). Copyright 2026 QueryTorque. This covers the extension, the bundled qt-dax engine and the bundled qt-shared runtime. Dependencies keep their own notices.
Need help or a wider review? querytorque.com/contact · Power BI performance reviews
Settings
| Setting |
Default |
Meaning |
querytorque.python.executable |
"" |
Path to CPython 3.12 x64. Empty = find it automatically (py launcher, uv, PATH) |
querytorque.cli.executablePath |
"" |
Advanced: override the QT:DAX command used by the extension |
querytorque.cli.installMethod |
"pip" |
pip or uv; both install the bundled, hash-locked packages offline |
querytorque.workbook.offline |
false |
true = review saved files only, without native runs |
querytorque.powerbi.directory |
"" |
Set only if Power BI Desktop can't be found automatically |
querytorque.sidecar.port |
8042 |
Optional local sidecar port |
Manual runtime recovery
The Install and Update commands handle this automatically. If you need to rebuild the private environment by hand, run the following from the installed extension folder:
py -3.12 -m venv "<new-runtime-directory>"
& "<new-runtime-directory>\Scripts\python.exe" -m pip --isolated install --no-index --find-links "<extension-install-dir>\runtime" --require-hashes -r "<extension-install-dir>\runtime\runtime-requirements.lock"
& "<new-runtime-directory>\Scripts\python.exe" -m pip --isolated install --no-index --no-deps "<extension-install-dir>\runtime\qt_shared-0.1.0-py3-none-any.whl" "<extension-install-dir>\runtime\qt_dax-1.1.1-py3-none-any.whl"
Then set querytorque.python.executable to the new environment's Python.
Command reference
| Command ID |
Command palette label |
querytorque.fixSlowReport |
QueryTorque: Help Me Fix This Slow Report |
querytorque.nativePrepare |
QueryTorque: Start Native Power BI Investigation |
querytorque.nativeMeasureOriginal |
QueryTorque: Measure Original Chart DAX |
querytorque.nativeTestPlan |
QueryTorque: Test Native Change Plan on Copy |
querytorque.nativeMeasureCandidate |
QueryTorque: Measure Candidate Chart DAX |
querytorque.nativeOpenWorkbench |
QueryTorque: Open Native Investigation Workbench |
querytorque.getStarted |
QueryTorque: Get Started |
querytorque.installCli |
QueryTorque: Install QT:DAX CLI |
querytorque.updateCli |
QueryTorque: Update QT:DAX CLI |
querytorque.checkPython |
QueryTorque: Check Python |
querytorque.cliStatus |
QueryTorque: Show QT:DAX Status |
querytorque.workbookDoctor |
QueryTorque: Run Workbook Doctor |
querytorque.selectWorkbook |
QueryTorque: Select Power BI Workbook |
querytorque.speedUpReport |
QueryTorque: Speed Up This Report |
querytorque.bottlenecks |
QueryTorque: Show Bottlenecks |
querytorque.importSweepEvidence |
QueryTorque: Import Sweep Evidence (PA, VPAX, Usage) |
querytorque.configureMcp |
QueryTorque: Configure Agents (MCP) |
querytorque.prepareAgentHandoff |
QueryTorque: Prepare/Open Agent Handoff |
querytorque.compareCandidate |
QueryTorque: Compare Candidate Results and Timings |
querytorque.compareCapturedCandidate |
QueryTorque: Compare Candidate with Captured Power BI Contexts |
querytorque.openLatestComparison |
QueryTorque: Open Latest Candidate Comparison |
querytorque.comparisonHistory |
QueryTorque: Browse Candidate Comparisons |
querytorque.applyReviewedChange |
QueryTorque: Apply Reviewed Change |
querytorque.rollbackChange |
QueryTorque: Roll Back Applied Change |
querytorque.appliedHistory |
QueryTorque: Applied Change History |
querytorque.desktopConnect |
QueryTorque: Connect to Open Power BI Desktop |
querytorque.desktopStatus |
QueryTorque: Show Desktop Status |
querytorque.desktopHealth |
QueryTorque: Show Desktop Health |
querytorque.workbookRun |
QueryTorque: Run Workbook Review |
querytorque.openLatestReview |
QueryTorque: Open Latest Review Report |
querytorque.openLatestFixPack |
QueryTorque: Open Latest Fix Pack |
querytorque.startSidecar |
QueryTorque: Start Local Sidecar |
querytorque.stopSidecar |
QueryTorque: Stop Local Sidecar |
querytorque.openCliDocs |
QueryTorque: Open QT:DAX Help |
querytorque.logView.exportJson |
QueryTorque: Export QT:DAX Log as JSON |
querytorque.logView.exportCsv |
QueryTorque: Export QT:DAX Log as CSV |
querytorque.logView.clear |
QueryTorque: Clear QT:DAX Log |
querytorque.workbookBrief |
QueryTorque: Workbook Flow (Legacy) |
querytorque.workbookAudit |
QueryTorque: Workbook Review (Legacy) |
querytorque.openLatestAudit |
QueryTorque: Open Latest Review (Legacy) |
querytorque.logView.snapshot |
Internal: read-only log snapshot (hidden from the palette) |