This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Your file has been submitted successfully. We’re processing it now - please check back in a few minutes to view your report.
04-10-2026 04:50 AM - last edited 04-13-2026 00:34 AM
Semantic Model Test Harness: Unit & Regression Testing for DAX
No one likes finding out a DAX measure broke because someone renamed a column last Tuesday. This notebook brings unit testing to semantic models in Microsoft Fabric.
You define test cases as rows in a DataFrame: the measure name, a filter context, and the expected value. The harness builds EVALUATE ROW(...) queries, sends them to your model via Semantic Link Labs' evaluate_dax_impersonation, and reports pass/fail with full traceability (actual vs. expected, the exact DAX query used).
What it does:
- Runs parameterized DAX tests against any Fabric semantic model
- Handles filter context quoting (single vs. double quotes) automatically
- Supports both boolean filters and table function expressions in CALCULATE
- Catches and logs errors instead of failing silently
- Produces a results DataFrame suitable for CI/CD pipeline integration
Built for BI developers and data engineers who want to validate business logic after model changes without opening a browser and eyeballing report pages. Drop the notebook into your workspace, define your tests, run it before or after deployments.
Requires: Microsoft Fabric workspace, a published semantic model, and the sempy_labs (Semantic Link Labs) package.
https%3A%2F%2Fgithub.com%2Fvestergaardj%2FSemantic-Link-TestHarness%2Fblob%2Fmain%2F2026_SemanticLink_vestergaardj_TestHarness.ipynb