Skip to main content

Model Lenz

Model Lenz

Open-source static analyzer for Power BI PBIP projects. For any DAX measure, it shows every table that measure depends on (directly through the expression, and indirectly through active relationships).

PyPI License: MIT Python GitHub Sponsors Buy Me a Coffee Microsoft MVP

If Model Lenz has saved you time on a model review, sponsor here — it takes 30 seconds:

Sponsor on GitHub Buy Me a Coffee


Why Model Lenz

  • One screenshot ends the "which tables does this measure actually touch?" thread. Direct DAX refs, transitively-resolved sub-measures, and indirectly-walked relationships (with USERELATIONSHIP overrides) — all in one graph you can paste into a PR.
  • Both names on every node, no mode toggle. A Power BI developer sees the semantic-model name they type in DAX. A data engineer sees the BigQuery FQN / SQL [schema].[table] / Snowflake DB.SCHEMA.TABLE / file path on the same node. Both sides read the same screenshot.
  • Diff two PBIPs (or two Git refs) on the graph itself. Green / amber / red borders on table cards and relationship edges show what changed. Catches the table-set drift that reviewers miss when they read DAX line by line.
  • Read-only, local, ad-free, no XMLA, no phoning home. Runs from a single Python wheel. Source control is the only prerequisite.

Use it in 30 seconds

uv tool install model-lenz                              # or: pipx install model-lenz
model-lenz demo                                         # bundled 5-table PBIP, opens in browser
model-lenz serve "C:\path\to\Sales.SemanticModel"      # your own PBIP

Nothing to clone. The wheel ships the CLI, the React UI, and a tiny demo PBIP.

Need help with PATH on Windows, updates, path forms, or troubleshooting? → docs/install.md


Sponsor

Model Lenz is free, ad-free, never phones home. Sponsorship is what decides what ships next. Right now your contribution funds:

  • model-lenz check for CI (v0.4). Shipped — fails a PR build on broken references, ambiguous propagation paths, or an indirect-table-set blow-up past your threshold. Next up: baseline-drift comparison (--git against main) so the gate catches a sudden blow-up, not just an absolute one.
  • Annotation layer on sub-graph exports. Inline reviewer comments on exported SVG / Mermaid attached to a PR.
  • Snowflake-native-SQL, Databricks, Synapse Serverless connectors. Each opens a class of warehouses Model Lenz currently labels with low confidence.

If the tool already saved you a model-review headache, that's the trade — one click, one coffee, more features for everyone:

Sponsor on GitHub Buy Me a Coffee

Sponsor at the $10+ tier and you'll be listed (with your consent) in the Hall of Sponsors. Top tier on GitHub Sponsors includes a 30-minute monthly call with a Microsoft MVP.


What's in the box

  • serve — interactive measure-dependency graph for any PBIP. Switch PBIPs in-app via the header Open… button; no server restart.
  • diff — two PBIPs (or two Git refs via --git) side-by-side on the same graph canvas, with a List tab for the per-entity audit. → docs/diff.md
  • summary / inspect — counts, classification breakdown, full parsed model as JSON. CI-friendly.
  • check — CI gate that fails a PR build on broken references, ambiguous propagation paths, or an indirect-table blow-up. Text / JSON output plus GitHub Actions annotations.
  • Share + embedCopy link (selection + depth in URL), Copy MD (one-pager handoff card), Copy Mermaid, Download SVG. Diff exports color both borders and arrows; removed edges render dashed.

Full CLI reference and feature table: docs/cli.md. Concepts and FAQ: docs/faq.md.


Roadmap

  • v0.3.x — diff polish. Shipped. Graph-canvas diff, shareable URLs, Markdown handoff cards, Mermaid / SVG exports, Git-ref diff mode. v0.3.2 colored relationship arrows in Mermaid diff exports.
  • v0.4 — guardrails before the merge. model-lenz check CI gate (shipped: broken-reference + ambiguous-path + static indirect-table-set blow-up rules; baseline-drift comparison still to come) · annotation layer on sub-graph exports.
  • Later. DMV / XMLA mode for deployed semantic models · .pbix adapter · perspective-aware views · Kimball-style bus-layout auto-arrangement.

Not on this roadmap by design: report-layer (PBIR) measure-usage — which pages and visuals consume each measure. That's what PBIP Lineage Explorer is for.

Have something else you'd like to see? Open a feature request. Sponsorship decides what ships first.


Also by Jihwan Kim

  • PBIP Lineage Explorer. Trace any visual back to its source columns through DAX. Browser-based, 100% client-side. "Where does the number on this card actually come from?"
  • PBIP Documenter. Generate bidirectional documentation (measures, tables, relationships, M-steps, native SQL) from PBIP/TMDL in seconds. "Can I hand someone a readable spec of this model without writing one?"

Together with Model Lenz, the three tools cover the model side, the report side, and the documentation side of a PBIP project without overlap.


More detail when you need it


Support development

Free tools survive when the people who get value from them give back. If Model Lenz saved you time on a model review, an audit, or a "wait, where does this column actually come from?" conversation, here's where:

Sponsor on GitHub Buy Me a Coffee

GitHub Sponsors runs $2 / $5 / $10 / $25 / $50 per month. Buy Me a Coffee is one-time, any amount. Both go to the same person.

Hall of Sponsors

Your name here. Sponsor at the $10+ tier and you'll be listed (with your consent) here on the README and on the project website.


License

MIT. Use it commercially, fork it, ship it inside whatever you're building. Attribution appreciated but not required.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

model_lenz-0.4.0.tar.gz (318.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

model_lenz-0.4.0-py3-none-any.whl (169.5 kB view details)

Uploaded Python 3

File details

Details for the file model_lenz-0.4.0.tar.gz.

File metadata

  • Download URL: model_lenz-0.4.0.tar.gz
  • Upload date:
  • Size: 318.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for model_lenz-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5285c918a41962b9513994706b3bf1fcc8558295ab79f5a5c3ac68a873d948cd
MD5 23b0f9c6f0e18b648f689c424f4888b6
BLAKE2b-256 a6c4fad9b4436b8dc1f2d4d5b40f1d6d211510d2b91635d582d1408569ff5ccc

See more details on using hashes here.

Provenance

The following attestation bundles were made for model_lenz-0.4.0.tar.gz:

Publisher: release.yml on JonathanJihwanKim/pbi-lineage-lenz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file model_lenz-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: model_lenz-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 169.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for model_lenz-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04fe6bd0db39a96d3220373e99d4518bd5ccbb942be25901a543fe3276bcad9f
MD5 78e33c37a050e8768d3703569c26be8b
BLAKE2b-256 f86225e22221e70250ba8db99886e836f2b0458f62ca88d9075dbdb3ba914438

See more details on using hashes here.

Provenance

The following attestation bundles were made for model_lenz-0.4.0-py3-none-any.whl:

Publisher: release.yml on JonathanJihwanKim/pbi-lineage-lenz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page