Articles · Business intelligence · · 9 min read

The Power BI Semantic Model as a Contract

If downstream reports, Excel pivots and DAX queries depend on your Power BI model, its names and semantics are an interface. Here's how to version it.

By Matthieu de La Mettrie · Founder, Skopura

A semantic model stops being a file the moment a second artefact points at it. A thin report in another workspace, an Excel workbook on someone’s laptop, a composite model built by a team you have never met, a paginated report, a Power Automate flow pulling a DAX query — each of those is a caller binding to names and meanings you control. At that point the model is an interface, and interfaces have rules about what may change silently and what may not.

Most of the pain in long-lived reporting comes from treating the model as private code. You rename a column because the new name reads better, you change a fact table’s grain because the source finally gave you line-level data, you tighten a measure’s filter logic because it was wrong. All three are defensible changes. All three can land as an outage or, worse, a silent restatement that nobody notices until a number is quoted in a meeting.

What exactly is the contract?

Not the whole model. The contract is the part of the model a caller can observe. Everything else is yours to change without ceremony.

A caller can observe names — tables, columns, measures, hierarchies, roles. A caller can observe semantics — what a measure means, what one row of a fact table represents, how a filter propagates, how a value formats when it lands in a cell. A caller can observe access — which role they are in and what that role filters. And a caller can observe freshness, whether or not you have given them a way to see it.

A caller cannot observe your Power Query steps, your partition boundaries, your storage mode choice, your intermediate hidden columns, or how you staged the data upstream. Those are implementation. You can rewrite them on a Tuesday.

Semantic model public surfaceNamesTable and column namesMeasure namesHierarchy and level namesRole namesSemanticsFact grain — what one row isMeasure definition and filter behaviourRelationship direction and cardinalityFormat strings and data typesAccessRow-level security rolesEndpoint availabilityFreshnessExpected refresh windowPublished as-at marker
The observable surface of a semantic model, decomposedStructure only — not a completeness claim

Why does a rename break things lineage does not show?

Because lineage only covers artefacts the service knows about. Rename a column and the thin reports in the same tenant will show you as broken visuals, which is loud and fixable. The Excel workbook that someone refreshes monthly, the DAX query embedded in a flow, the composite model chained off yours — those fail quietly, at the caller’s convenience, and the failure arrives as a support ticket with no stack trace.

This is why renaming is the most expensive cheap change in reporting. The cost is not the edit. The cost is that you cannot enumerate your callers.

The practical discipline is to make renames additive first. Introduce the new name, keep the old one as a hidden alias — a measure that simply returns the new measure, or a column retained alongside the replacement. Mark the old one with a description and move it to a display folder that says what it is. Announce the removal as a dated release of the model, not as a side effect of someone’s cleanup pass. Then remove it in that release and only in that release.

Which changes are breaking even though nothing errors?

The dangerous class is the one where the name survives and the meaning moves. Nothing throws. Visuals keep rendering. The numbers are different.

Three common cases:

Grain changes. A fact table moves from one row per order to one row per order line. Sums of amount may stay identical if you split the amount correctly. Counts, averages and distinct counts do not. Any measure built as COUNTROWS against that table has changed meaning without changing text.

Filter behaviour changes. You turn on bi-directional filtering to fix one visual. Every other measure that crosses that relationship now evaluates in a different context. The fix is local; the blast radius is not.

Measure corrections. A measure was wrong, you fixed it, history moved. This is the right thing to do and it is still a breaking change. If the meaning of a published measure changes, change the name or publish a restatement note. A number that quietly differs from last month’s screenshot costs more trust than a rename costs effort.

Published surfaceImplementation detail
Measure and column namesChanging them breaks callers you cannot enumerateHidden helper columns are free to rename
Measure meaningA corrected definition is a restatementRefactoring that preserves results is silent
Fact grainCounts and averages shift without erroringStaging shape upstream is invisible
Storage and partitionsOnly visible through freshness and latencyChange at will, verify with query tests
RLS rolesRole names and their filter effect are observableHow the filter expression is written is not
Format stringsThey land in exported cells and printed reportsVisual-level formatting stays with the report
Where the line sits between published surface and implementation detailQualitative — judgement, not policy

How do you test a model the way you test a pipeline?

Put the model definition in source control as TMDL, and run two kinds of check before anything reaches the workspace users read from.

The first is a surface diff. Maintain a declared list of the public objects — the measures, columns and roles you consider contractual — and fail the build when something on that list disappears or changes name without an accompanying release note. This is dull, mechanical, and it catches the cleanup-pass rename every time.

The second is a pinned-value check. Choose a historical window that should never move, pick a handful of measures crossed with a few dimension slices, and record the results. Run the same DAX queries against the model via the XMLA endpoint after deployment and compare. Any difference in a frozen window is either a deliberate restatement or a bug, and the harness does not care which — it stops and makes a human say.

Pinned measure checks against a frozen windowts
1234567891011121314151617181920212223242526272829303132
type Pin = {
name: string;
dax: string;      // EVALUATE over a closed historical window
expected: string; // recorded once, reviewed on change
};

const pins: Pin[] = [
{
  name: "net_revenue_by_region_closed_year",
  dax: `EVALUATE
    SUMMARIZECOLUMNS(
      'Region'[RegionName],
      FILTER(ALL('Date'), 'Date'[FiscalYear] = "FY-CLOSED"),
      "NetRevenue", [Net Revenue]
    )`,
  expected: "pins/net_revenue_by_region_closed_year.json"
},
{
  name: "order_count_grain_guard",
  dax: `EVALUATE ROW("Orders", [Order Count], "Lines", [Order Line Count])`,
  expected: "pins/order_count_grain_guard.json"
}
];

// Run after deploying to the test stage, before promoting.
// A difference is not automatically a failure — it is a decision.
export async function verify(endpoint: string) {
for (const pin of pins) {
  const actual = await executeDax(endpoint, pin.dax);
  assertMatchesSnapshot(pin.name, actual, pin.expected);
}
}
Shape of a post-deployment model checkIllustrative snippet — no claim about output

The grain guard in that snippet is worth calling out. Pinning an order count alongside a line count is a cheap tripwire: if someone changes what a row of the fact table means, the two values converge or diverge and the check fires. You do not need coverage of every measure. You need coverage of the assumptions that, when broken, break everything downstream of them.

Should freshness be in the contract?

Yes, and it should be visible rather than documented. Expose an as-at marker as a measure in the model so that any report, including ones you did not build, can put it on the canvas. A semantic layer centralises metric definitions so separate reports agree; the same logic applies to the statement of how current those metrics are. If the answer lives only in a refresh history page that consumers cannot reach, every stale-looking number becomes a question directed at you.

Incremental refresh processes only changed partitions rather than a full dataset, which means the freshness story is rarely uniform across the model. Recent partitions may be current while an archived range is frozen at its last processed state. Say so in the model. A single marker that reports the maximum processed date of the fact table is better than silence and better than a wiki page.

How do you decide whether a change is breaking?

The test is not “will something error”. The test is “could a caller’s number change, or a caller’s reference stop resolving, without them acting”.

Is this a breaking change?

Breaking. Add the replacement first, deprecate with a description, remove in a named release.

Triage for a proposed model changeDecision aid — not a substitute for review

Who owns the contract?

Someone has to be able to say no to a rename. That is the whole governance requirement, and it does not need a committee. It needs a named owner per model, a repository where the definition lives, and a release note that consumers can subscribe to. Deployment pipelines give you the stages; the owner gives you the judgement about what gets promoted.

The failure pattern is a model with many editors and no owner, where each change is individually reasonable and the aggregate is a surface that drifts under its callers. The report that worked last quarter now returns a different number and nobody can name the change that did it, because there were eleven changes and no record of which ones touched the surface.

Treat the semantic model the way you would treat a published API. Additive changes are free. Renames go through deprecation. Meaning changes get announced. Everything behind the surface is yours. That is not heavyweight process — it is four rules, and they are the difference between reporting that accumulates trust and reporting that quietly spends it.

Where to start if none of this exists yet

Export the model to TMDL and commit it. Write down the list of measures and columns you consider public — the ones that appear on reports other people own. Add descriptions to those and only those. Pick five numbers from a closed historical period and pin them. Add an as-at measure. That is a day’s work on an existing model, and it converts every future change from a guess into a check.

power-bi · semantic-model · data-contracts · dax

Share on LinkedIn ↗

Work with Skopura

Facing this bottleneck in your own estate?

Skopura builds production-grade lakehouse pipelines, evaluation harnesses, and provides fractional data leadership. Thirty-minute call, no deck.

Book a 30-min call →Email directly

Further reading

Business intelligence · 8 min

Why a Power BI Measure Is Wrong and Nobody Noticed

A measure that returns a plausible number fails silently. Where Power BI measures go wrong, why the report can't catch it, and how to make them testable.

Business intelligence · 7 min

Power BI Row-Level Security That Does Not Leak

Row-level security fails at the edges — filter direction, bridge tables, aggregations and composite models. The patterns that hold, and how to test them.