Skip to content

JonathanJihwanKim/pbip_model_lenz

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.

About

Open-source PBIP analyzer for Power BI / Fabric. One graph, two readings: PBIP names for the BI developer, source-system names for the data engineer. Click a measure, see every table it really depends on — directly and through active relationships. Read-only static analysis.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors