BIKit Lite

Fast, deterministic static linter for Power BI Project (PBIP) and TMDL models. Enforce architectural quality gates, catch DAX context transitions, and block anti-patterns before merging to main.

The in-browser playground below is live. The bikit CLI and the CI commands on this page are not published to npm yet, so npx bikit will not work until the first release.

$npx bikit inspect ./definition
$npx bikit init
Browse 11 Rules
TMDL Input Model

Edit TMDL below or paste your model definition. Changes evaluate deterministically in real time.

Gate Failed (46/100)
┌────────────────────────────────────────────────────────┐
│  BIKit Lite — Power BI TMDL & PBIP Quality Gate       │
└────────────────────────────────────────────────────────┘

  Model Stats: 2 tables, 3 measures, 1 relationships
  Duration: 1ms

  Findings (10):

  [WARN]  BK_DAX_001: Unsafe Division Operator in DAX Measure
         model.tmdl:6 
         Measure [Gross Margin] in table 'Sales' uses raw division operator '/'. Use DIVIDE() to protect against division by zero.
         > [Total Profit] / [Total Revenue]
         → Fix: Wrap with DIVIDE(): DIVIDE([Profit], [Revenue])

  [INFO]  BK_DAX_003: Missing Format String on Numeric Measure
         model.tmdl:6 
         Measure [Gross Margin] does not specify an explicit formatString property.
         → Fix: Specify formatString: "#,##0.00" or currency format in TMDL.

  [WARN]  BK_GOV_001: Undocumented Business Measure
         model.tmdl:6 
         Measure [Gross Margin] lacks documentation or business description in TMDL metadata.
         → Fix: Add description: "Clear explanation of business logic" above the measure definition.

  [ERROR] BK_DAX_002: Context Transition inside Row-by-Row Iterator
         model.tmdl:9 
         Measure [Row Iteration Cost] calls measure references inside an iterator. This triggers row-to-filter context transition for every row in the iterated table.
         > SUMX(Sales, [Gross Margin] * 1.05)
         → Fix: Precalculate the context or evaluate columnar operations directly inside the iterator.

  [INFO]  BK_DAX_003: Missing Format String on Numeric Measure
         model.tmdl:9 
         Measure [Row Iteration Cost] does not specify an explicit formatString property.
         → Fix: Specify formatString: "#,##0.00" or currency format in TMDL.

  [INFO]  BK_DAX_003: Missing Format String on Numeric Measure
         model.tmdl:13 
         Measure [Redundant Calc] does not specify an explicit formatString property.
         → Fix: Specify formatString: "#,##0.00" or currency format in TMDL.

  [INFO]  BK_DAX_004: Redundant CALCULATE Wrapper
         model.tmdl:13 
         Measure [Redundant Calc] wraps a single simple aggregation in CALCULATE() without filter arguments.
         > CALCULATE(SUM(Sales[Amount]))
         → Fix: Remove the outer CALCULATE() wrapper.

  [WARN]  BK_GOV_001: Undocumented Business Measure
         model.tmdl:13 
         Measure [Redundant Calc] lacks documentation or business description in TMDL metadata.
         → Fix: Add description: "Clear explanation of business logic" above the measure definition.

  [ERROR] BK_MOD_001: Bidirectional Cross-Filtering Relationship
         Relationship between 'Sales'[CustomerKey] and 'Customer'[CustomerKey] has crossFilteringBehavior set to 'bothDirections'.
         → Fix: Change to single-direction filtering. Use CROSSFILTER() inside specific DAX measures if required.

  [WARN]  BK_MOD_004: Unsplit High-Cardinality DateTime Column
         model.tmdl 
         Column 'Sales'[OrderDateTime] appears to be a combined DateTime column. High cardinality degrades VertiPaq compression.
         → Fix: Split into separate [Date] and [Time] columns in Power Query / ETL.

──────────────────────────────────────────────────────────
  Quality Score: 46/100  |  Status: FAILED (Quality gate threshold not met)
  2 Errors, 4 Warnings, 4 Info
──────────────────────────────────────────────────────────
2 errors, 4 warnings, 4 info

Integrate BIKit Into Your CI Pipeline in 60 Seconds

Run automated quality gates on every Pull Request containing TMDL or PBIP semantic model changes.

.github/workflows/bikit-pr-check.yml
name: Power BI Quality Gate (BIKit)
on:
  pull_request:
    paths: ['**/*.tmdl', '**/model.bim']
jobs:
  bikit-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20 }
      - run: npx bikit lint . --format=github-pr >> $GITHUB_STEP_SUMMARY
.bikitrc.json (Repository Config)
{
  "minScore": 80,
  "failOn": "error",
  "ignoreRules": []
}

BIKit Rule Directory (11 Deterministic Checks)

Every rule is deterministic, explainable, and backed by production Fabric/VertiPaq benchmarks.

BK_DAX_001warning
dax

Unsafe Division Operator in DAX Measure

Measure uses the raw '/' division operator instead of the safe DIVIDE() function.

Why it matters:

Direct division by zero returns NaN or infinity in VertiPaq engine, which can crash front-end visual rendering or yield misleading totals. DIVIDE() provides safe default handling (BLANK or alternate result).

Fix: Replace [Numerator] / [Denominator] with DIVIDE([Numerator], [Denominator]).
BK_DAX_002error
dax

Context Transition inside Row-by-Row Iterator

Measure reference detected inside an iterator function (SUMX, AVERAGEX, FILTER).

Why it matters:

Invoking a measure inside an iterator triggers row context to filter context transition for every row, converting a columnar VertiPaq scan into a slow row-by-row iteration.

Fix: Pre-calculate the filter context or evaluate the column operation directly inside the iterator before invoking CALCULATE.
BK_DAX_003info
governance

Missing Format String on Numeric Measure

Numeric DAX measure does not define an explicit format string.

Why it matters:

Measures without formatString render with arbitrary floating-point decimal precision in Power BI Service visuals and Excel Analyze in Power BI.

Fix: Add an explicit formatString property (e.g. formatString: "#,##0.00" or "$#,##0").
BK_DAX_004info
dax

Redundant CALCULATE Wrapper

CALCULATE() wraps an expression without any filter modifier arguments.

Why it matters:

CALCULATE with only 1 argument forces a context transition unnecessarily when executed in row context, and adds syntactic noise.

Fix: Remove the outer CALCULATE() wrapper if no filter modifiers or context transition is required.
BK_DAX_005warning
performance

Full Table Scan in FILTER() Argument

FILTER() iterates an entire entity table rather than a single column or projection.

Why it matters:

Passing a wide fact or dimension table into FILTER() forces VertiPaq to materialize all table columns in memory. Filtering a specific column (e.g., KEEPFILTERS(Sales[Status] = "Active")) allows storage engine bitmask filtering.

Fix: Filter the specific column directly or wrap with KEEPFILTERS().
BK_MOD_001error
modeling

Bidirectional Cross-Filtering Relationship

Relationship has crossFilteringBehavior set to 'bothDirections'.

Why it matters:

Bidirectional relationships cause ambiguous query filter paths, unpredictably inflate VertiPaq query times, and can produce mathematically incorrect totals across non-conformed dimensions.

Fix: Use single-direction filtering and activate bidirectional filtering only where strictly necessary via CROSSFILTER() in individual DAX measures.
BK_MOD_002warning
modeling

Many-to-Many Relationship Without Bridge

Direct Many-to-Many relationship defined between model tables.

Why it matters:

Direct Many-to-Many relationships bypass standard 1-to-Many VertiPaq hashing, resulting in slower in-memory joins and potential cross-filtering hazards.

Fix: Introduce a shared 1-to-Many bridge dimension or distinct lookup table.
BK_MOD_003warning
performance

Auto Date/Time Hierarchy Bloat

Dataset contains auto-generated hidden LocalDateTable entities.

Why it matters:

Power BI's Auto Date/Time feature generates a hidden calendar table for every single date/time column in the model, bloating file size and RAM.

Fix: Disable Auto Date/Time in model settings and establish a centralized marked Date/Calendar dimension.
BK_MOD_004warning
performance

Unsplit High-Cardinality DateTime Column

Combined Date + Time column detected with timestamp precision.

Why it matters:

VertiPaq compresses columns using run-length and dictionary encoding. A combined DateTime column can possess millions of distinct values, destroying compression efficiency.

Fix: Split the column in Power Query / ETL into a Date column and a separate Time or Hour column.
BK_GOV_001warning
governance

Undocumented Business Measure

DAX measure lacks a business description in TMDL metadata.

Why it matters:

Undocumented measures prevent self-service discoverability, break automated dictionary generation, and increase maintenance costs in enterprise models.

Fix: Add a 'description:' property in TMDL or description metadata in BIM.
BK_PERF_001error
performance

Calculated Column in Direct Lake Model

Calculated column defined on a Direct Lake table.

Why it matters:

Fabric Direct Lake queries fallback to DirectQuery SQL endpoint whenever a visual requests a DAX calculated column, sacrificing VertiPaq in-memory performance.

Fix: Materialize calculated columns upstream in Fabric Lakehouse Delta tables or views before semantic ingestion.

Privacy: the analysis runs in your browser and your TMDL never leaves it. I only count that the tool was used and when a report is downloaded — no inputs, results or personal data are recorded.

Get the next Engineering Note

Practical DAX, semantic model and Fabric notes. 1–2 a month, unsubscribe any time.

1–2 useful notes a month. Unsubscribe at any time.

Stop Semantic Regressions Before They Reach Production Fabric Capacities

Historically, Power BI models were binary black boxes (.pbix). Engineers could only discover expensive Cartesian joins or memory-bloating Auto Date/Time tables after reports were deployed and users complained. With TMDL (Tabular Model Definition Language), semantic models are human-readable text. BIKit turns that text into an automated CI quality gate.

Branching Discipline

Catch merge conflicts, invalid syntax, and missing format strings before a PR merges into your release branch.

Capacity Sizing Protection

Prevent high-cardinality DateTime timestamps and Direct Lake calculated column fallbacks that exhaust Fabric CUs.

Zero-Hallucination Gate

100% deterministic rule execution with clear error codes, specific line numbers, and actionable remediation formulas.

Frequently Asked Engineering Questions

Technical specifics on running BIKit in local and cloud CI/CD environments.

Does BIKit send our model metadata or connection strings to any cloud server?

No. BIKit Lite runs 100% locally on your machine or inside your GitHub Actions / Azure DevOps runner container. Zero telemetry, zero external network calls, and zero credentials transmitted.

How does BIKit handle both TMDL files and legacy model.bim?

BIKit automatically detects file extensions. If passed a folder, it scans recursively for *.tmdl definitions and any model.bim Tabular JSON files, unifying them into a normalized model representation for rule checks.

Can we customize thresholds or ignore specific rules?

Yes. Create a .bikitrc.json in your repository root with ignoreRules: ["BK_DAX_003"] or setminScore: 85. Flags like --fail-on=error ensure advisory warnings do not break builds during migration.

Does BIKit work with Azure DevOps Pipelines?

Yes. Simply add a Node.js task in your azure-pipelines.yml that executes npx bikit lint ./definition. The process exits with code 1 upon failure, properly halting pipeline deployment tasks.