Deterministic Documentation
Tables, columns, measures, hierarchies, and relationships extracted directly from metadata. DAX expressions preserved verbatim with optional multi-provider AI interpretations tagged by confidence level.
Static analysis, architectural verification, and automated quality gates for Tabular models. Audit 8 best-practice rules, export standalone offline HTML reports, write descriptions directly back into your model, and bridge verified semantic contracts into Claude dashboards and Microsoft Fabric Rayfin data apps.
'Customer'[RegionKey] ↔ 'Region'[RegionKey]
'Sales'[Amount Band]
'Region'
'Sales'[OrderDate]
'Customer'
Verified output from sample SalesModel fixture.
Production models accumulate hundreds of measures, unoptimized relationships, and undocumented DAX dependencies over years of releases. Manual documentation is obsolete the moment it is written, while generic LLM chats hallucinate calculations without ground-truth metadata. RefactorBI executes factual extraction deterministically, isolating AI interpretation to strictly verified review queues.
Tables, columns, measures, hierarchies, and relationships extracted directly from metadata. DAX expressions preserved verbatim with optional multi-provider AI interpretations tagged by confidence level.
Export self-contained, single-file HTML reports with zero CDN dependencies. Features real-time client-side table and measure search, syntax formatting, and health drilldowns for air-gapped corporate networks.
Run refactorbi check in GitHub Actions or Azure DevOps to fail pull requests on architectural regressions. Enforce minimum score thresholds (e.g. --min-score 70) and zero high-severity errors.
Bring your own API key for Google AI Studio (Gemini 3.8 Flash, 3.5 Flash Lite, 3.1 Pro), Anthropic Claude, or OpenAI. Queries and discovers available models live. Credentials remain in-memory with zero disk persistence.
A 0-100 score and A-F grade evaluated against 8 structural rules: bi-directional filters, exposed foreign keys, calculated fact columns, many-to-many cardinality, broken relationships, ambiguous DAX, undocumented tables, and orphan measures.
Entity-relationship diagram with cardinality and filter propagation, plus measure dependency graphs that reveal downstream impact before modifying or deprecating DAX logic.
Synchronize approved descriptions back into your model as native tooltips. Export an enriched .bim or generate Tabular Editor C# scripts. Existing descriptions are protected unless explicitly overwritten.
Parse PBIR or .pbix report layouts to map field and measure bindings across visuals, identifying high-impact metrics and flagging dead-weight measures with zero references.
Review and verify AI-generated enrichments before sign-off. Export immutable compliance audit logs (signoff_audit.json) with reviewer stamps for enterprise data cataloging.
Live deliverables generated from our sample SalesModel fixture.
Sales LY Metadata factSales[Total Sales], 'Date'[Date]CALCULATE (
[Total Sales],
SAMEPERIODLASTYEAR ( 'Date'[Date] )
)
Total sales for the same period one year earlier, utilized for year-over-year performance benchmarking. Requires continuous date sequences on the marked Date dimension.
AI interpretations are quarantined with confidence indicators until reviewed and approved by an engineer.
Self-hosted offline technical documentation report with embedded dark CSS, client-side table and measure search filter, DAX syntax formatting, and health scorecard. Committable to Git or distributable to business stakeholders on air-gapped corporate networks.
# Export standalone offline HTML documentation report via CLI:
refactorbi export ./SalesModel.pbip --formats html --out ./dist/
# Output generated:
# ./dist/SalesModel-documentation.html (100% offline, zero external requests)
# Or download directly from Web Workbench:
GET /api/download?format=html -> SalesModel-documentation.html
# .github/workflows/refactorbi-quality-gate.yml
name: Power BI Model Quality Gate
on: [pull_request]
jobs:
audit-semantic-model:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install RefactorBI
run: pip install refactorbi
- name: Run Model Quality Gate
run: |
refactorbi check ./models/SalesModel.pbip \
--min-score 70 \
--max-high 0 \
--format github
Maps direct and indirect DAX dependency chains to prevent regressions.
// Tabular Editor C# Script: updates live model descriptions
Model.Tables["Sales"].Measures["Sales LY"].Description =
"Total sales for the same period in the previous year.";
Model.Tables["Customer"].Description =
"One row per customer, with region assignment.";
// Existing descriptions preserved unless overwrite is enabled.
// rayfin_schema.ts: Compiled for Microsoft Fabric Rayfin Data Apps
export interface SalesModelSchema {
tables: {
Sales: { columns: ["CustomerKey", "OrderDate", "ShipDate", "Amount"] };
Customer: { columns: ["CustomerKey", "CustomerName", "RegionKey"] };
};
verifiedMeasures: {
"Total Sales": { dax: "SUM(Sales[Amount])", concept: "Gross Revenue" };
"Sales LY": { dax: "CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))", concept: "Prior Year Comp" };
};
}
// Ready for: npx rayfin up OR direct import into Claude Projects
Block breaking changes, relationship errors, and model quality degradation before code merges into main.
Add refactorbi check to your pull request workflow. The CLI parses Tabular models in milliseconds, audits 8 structural rules, and outputs GitHub step summaries with clear failure diagnostics.
--min-score 75)--max-high 0)$ refactorbi check ./SalesModel.pbip --min-score 70 --max-high 0
[FAIL] Quality Gate Failed
- Health Score: 54/100 (Threshold: 70)
- High Severity Violations: 3 (Allowed: 0)
Violations:
[HIGH] BP-01: Bi-directional filter on 'Customer'[RegionKey]
[HIGH] BP-03: Calculated column in fact table 'Sales'[Amount Band]
[HIGH] BP-05: Relationship targets missing table 'Region'
Process completed with exit code 1.
Avoid rebuilding production metrics by hand. RefactorBI compiles legacy semantic models into typed, machine-readable contracts for AI coding agents and custom data apps.
Export token-optimized claude_agent_context.md manifests with verified metric formulas, table relationships, and filter contexts. Build interactive dashboards and answer executive questions without hallucination.
Generate production-ready TypeScript schemas (rayfin_schema.ts) ready for Fabric's Rayfin CLI. Build custom, interactive React and Plotly operational data applications wired directly to OneLake.
Identify unreferenced measures across all report visuals and filters. Prune abandoned legacy calculations before migrating a single line of application code.
| Format | Extracted Content |
|---|---|
| PBIP (zipped project) | Semantic model (TMDL or BIM) and report layout visuals for complete audit coverage |
| TMDL | Tables, columns, measures, hierarchies, and relationships in tabular definition language |
| BIM / TMSL | Full Tabular model JSON exported from Tabular Editor, Visual Studio, or Microsoft Fabric |
| PBIR | Report pages, visuals, and specific field bindings |
| PBIX | Report layout layer: pages, visuals, and bound measures. Save as .pbip in Power BI Desktop for data model metadata. |
Supports bring-your-own-key (Claude, OpenAI, Gemini) or internal enterprise gateway. When AI is disabled, zero data leaves your machine.
| Capability | Manual Docs | Generic LLM Chat | Tabular Editor | RefactorBI |
|---|---|---|---|---|
| Time to Full Document | Days | Hours (copy-paste) | Scripting required | Seconds |
| Ground-Truth Separation | None | No (hallucinations) | None | Yes (fact vs inference) |
| Dynamic Multi-Provider AI | No | Unverified | Manual | Yes (Live Model Discovery) |
| Standalone Offline HTML Report | No | No | No | Yes (Zero CDN Dependencies) |
| Automated CI/CD Quality Gate | No | No | Scripting required | Yes (refactorbi check) |
| Best-Practice Architecture Audit | No | No | Yes (BPA rules) | Yes (8 rules + scorecard) |
| Lineage & ER Diagrams | Manual | No | Partial | Yes (ERD + DAX trees) |
| Tabular Model Write-Back | Manual | No | Yes | Yes (.bim + TE scripts) |
| Visual Usage Audit | No | No | No | Yes (PBIR / PBIX) |
| Claude & Rayfin Contract Bridge | No | No | No | Yes (0% metric drift) |
| Governance Sign-Off Audit Trail | Manual | No | None | Yes (signoff_audit.json) |
RefactorBI generates scripts compatible with Tabular Editor 2 and 3.
RefactorBI is distributed as a community utility for Power BI developers, analytics engineers, and BI consultants.
Fully-featured for individual developers and internal engineering teams
Future hosted edition for enterprise organizations
Community edition is free for personal, internal, and client engagements. No credit card, no telemetry, no invoices.
Yes. RefactorBI compiles a single-file HTML document with embedded dark CSS, syntax highlighting, and an offline search filter for tables and measures. It requires zero CDN requests, zero external scripts, and zero network access.
Run refactorbi check <path> --min-score 70 --max-high 0 in your pull request workflow. The command audits the semantic model in milliseconds, returns exit code 1 if thresholds fail, and generates a formatted GitHub step summary of all detected anti-patterns.
When you enter your Google AI Studio, Anthropic, or OpenAI API key in the Web Workbench, RefactorBI queries the provider API in real time to enumerate all models available for your account (prioritizing gemini-3.8-flash, gemini-3.5-flash-lite, claude-3-5-sonnet, and gpt-4o). Keys are stored only in transient session memory and are never saved to disk.
No. Documentation extraction, health scores, lineage diagrams, and write-back scripts execute deterministically without AI. AI explanations are strictly optional: you can supply your own API key for Google AI Studio, Anthropic Claude, or OpenAI, or connect an internal corporate proxy.
Metadata facts (tables, columns, data types, relationships, DAX formulas) are parsed directly from source files and are never passed through an LLM. AI is only used for descriptive interpretations, which are tagged with confidence indicators and quarantined in a review queue until an engineer approves them.
For .pbix files, RefactorBI parses the report layout layer: pages, visuals, and bound measures. Because the internal data model in a .pbix is compressed and proprietary, full model documentation requires saving the project as a Power BI Project (File → Save as → .pbip) and uploading the folder.
Never directly. Write-back outputs a new .bim file or a Tabular Editor C# script that you review and execute inside your development environment. Existing descriptions are preserved unless you deliberately choose to overwrite them.
No. DAX expressions are analyzed statically as text: they are never executed, and RefactorBI never connects to your underlying databases or data sources.
You can upload models exported via Power BI Desktop, Tabular Editor, or Fabric Git integration (TMDL/PBIP). Direct workspace API synchronization is part of the cloud roadmap preview.
Join the early access waitlist for developer downloads, CLI releases, and cloud workspace updates.
You will only receive notifications regarding RefactorBI releases and access. Unsubscribe anytime. View our Privacy Policy.