← writing
18 February 2026

TMDL in Fabric: two routes for the same file

Now that a semantic model is written as text, it can be reviewed and versioned like code. There remain two ways of deploying it, with different costs, suited to different teams.

For years a semantic model was a binary file. It could not be reviewed by several people, changes could not be compared, and two pieces of work could not be merged; review meant opening the tool and looking. The text format solves all three problems: a measure takes a few lines, differences between versions become readable again, and deployment can be handled in the same terms as code.

text
/// Revenue excluding tax, at invoice date.
measure 'Revenue ex tax' =
    SUMX ( Sales, Sales[quantity] * Sales[unit_price] )
    formatString: #,##0 €
    displayFolder: Measures\Sales

    annotation PBI_FormatHint = {"currencyCulture":"fr-FR"}

Five lines a colleague can question in review. The two deployment methods below both start from this file, which is what makes them comparable.

01The built-in route

The platform has successive workspaces (development, test, production) and a mechanism that copies the contents of one into the next. Deployment rules replace what has to change along the way: the data source, a parameter, a connection. There is nothing to write; everything is configured in an interface.

It is the right method for a team that has no integration pipeline and does not want one. It has two limits to know before committing to it. Deployment rules are stored in the platform, not in the repository: they are neither versioned nor reviewed, and nobody can say what they contained three months ago. And deployment is triggered manually or from within the platform, so it cannot be made conditional on a test suite passing elsewhere.

02The integration-chain route

The other method uses the platform’s command line, installed on a runner and driven by the same pipeline file as the rest of the repository. Deployment becomes one step among others: it runs after the tests, can be rerun and leaves a record.

yaml
deploy-semantic-model:
  stage: deploy
  image: python:3.12-slim
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
  before_script:
    - pip install --quiet ms-fabric-cli
    # Service principal, not a named account: a pipeline must not stop working
    # because somebody changed team.
    - fab auth login -u $FAB_CLIENT_ID -p $FAB_CLIENT_SECRET --tenant $FAB_TENANT
  script:
    - fab import /Prod.Workspace/Sales.SemanticModel -i ./models/Sales.SemanticModel -f
    - fab import /Prod.Workspace/Sales.Report -i ./reports/Sales.Report -f
    # The refresh after import: without it the model is deployed but empty, and
    # the report shows blank cells to whoever opens it first.
    - fab job run /Prod.Workspace/Sales.SemanticModel -P refreshType=full

This method has two costs. It needs a service principal, its permissions on the workspaces and the rotation of its secret, three tasks that belong to a platform team rather than a BI team. And part of what the interface did without effort, such as switching the source between environments, has to be rewritten as parameters.

03Which one, and for whom

Neither method is better in absolute terms, and the deciding criterion is not technical. The question is who steps in when a report is wrong on a Monday morning. If it is the BI team itself, the built-in method keeps its autonomy and spares it from depending on a pipeline it cannot debug. If it is a platform team already responsible for everything else, the semantic model should follow the same path as the rest, otherwise it becomes the only component whose history nobody knows.

04Testing a semantic model

I do not cover testing a semantic model, which both methods lack. We know how to deploy, but not how to check automatically that a measure returns the same result as before, even though that check would distinguish this pipeline from a simple file transfer. Solutions exist, but none seemed simple enough for the team to maintain after I left, and I would rather say so than imply the question is settled.