The Python Library That Reads Your Power BI Models Like Data. Most Fabric Teams Have Never Opened It.
Last Updated on July 20, 2026 by Editorial Team
Author(s): Gulab Chand Tejwani
Originally published on Towards AI.
Semantic Link — the SemPy library — ships preinstalled in every Fabric notebook. It can list every measure in your tenant’s models, evaluate them with filters from Python, run DAX programmatically, and validate your data against the relationships your model claims to have. I’ve used it to automate work that used to consume entire client weeks. Here’s the practitioner’s tour, with the code.
Here’s a question I ask data teams when I audit their Fabric estates: “How do you verify that the measure values in your semantic model match the source tables in your lakehouse?”

After introducing the problem with manual “eyeballing” of semantic-model results, the article explains what Semantic Link (SemPy) actually is inside Fabric: a Python library plus a Spark-native connector that treats semantic models as a programmable, queryable surface. It then walks through the core workflow (list models/measures, evaluate measures with filters, run DAX, read tables with semantics) and focuses on three high-value use cases: automated measure validation via reconciliation against lakehouse results, relationship and data-quality validation to catch orphaned keys and silent row drops, and living documentation by exporting measures/tables/relationships on a schedule into diffable, queryable records. The author provides a worked “reconciliation notebook” skeleton with explicit contracts, tolerances, and persisted results for historical drift tracking, compares SemPy with the companion semantic-link-labs tooling, notes practical limitations (Fabric-only, not a modeling tool, read paths are most dependable, and capacity consumption matters), and ends with a practitioner verdict encouraging teams to adopt the library to prevent long-lived metric drift and keep model facts continuously verified.
Read the full blog for free on Medium.
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.
Published via Towards AI
Towards AI Academy
We Build Enterprise-Grade AI. We'll Teach You to Master It Too.
15 engineers. 100,000+ students. Towards AI Academy teaches what actually survives production.
Start free — no commitment:
→ 6-Day Agentic AI Engineering Email Guide — one practical lesson per day
→ Agents Architecture Cheatsheet — 3 years of architecture decisions in 6 pages
Our courses:
→ AI Engineering Certification — 90+ lessons from project selection to deployed product. The most comprehensive practical LLM course out there.
→ Agent Engineering Course — Hands on with production agent architectures, memory, routing, and eval frameworks — built from real enterprise engagements.
→ AI for Work — Understand, evaluate, and apply AI for complex work tasks.
Note: Article content contains the views of the contributing authors and not Towards AI.