← awmium/portfolio
portfolio/measure-chain.mdread-only
---
tags: [tmdl, m, parsers]
stack: [tmdl, javascript, python]
read: 1 min
---

Measure Chain

Measure Chain turns a semantic model’s DAX into a dependency graph. Paste TMDL or drop .tmdl files in, and it shows which measures feed which, grouped by display folder. I built it first as a Fabric Data App, then as a single HTML file, with a sibling Query Chain that does the same for Power Query M.

How it works

  • Measure Lineage draws the folder-grouped graph with a barycenter layout. Click a measure for its DAX and both reference lists, or use focus mode to narrow the canvas to one measure and its direct neighbours.
  • Model Metadata lists tables, columns and measures with every property the TMDL declared. DAX Breakdown re-indents one measure with the measures it references nested underneath.
  • The HTML edition is one 345 KB file: no framework, no network, no sign-in. Nothing leaves the tab.
  • The parsers exist twice: JavaScript for the browser, and stdlib-only Python with a CLI so an agent skill can call them. Tests assert the two agree byte for byte (139 checks for TMDL, 112 for M, plus 24 parity dumps).

Why it matters

Two implementations that can disagree are one implementation and one liability. Testing them against each other means the page and the CLI can never disagree about what a model contains.

read# Measure Chain[ ] sections216 words · 1 min · utf-8 · LFTop