Power BI and Microsoft 365 / practical developer guides

Master Power BI TMDL 2026 : Edit Semantic Models Natively

TMDL is useful when you can see exactly what a model change will do. Start by scripting one existing measure, changing its description, previewing the model diff and checking the saved result. Avoid bulk renames until you have a recoverable baseline and dependency tests.

Documentation reviewed 2026-10-30. Start small, inspect the evidence, test the permission boundary.

1. Separate the language, editor and stored definition

SurfacePurposeImportant distinction
TMDL definition in PBIPSerializes a semantic model for source controlThe definition folder replaces model.bim for a TMDL project.
TMDL viewScripts and applies model metadata operationsWorks with the current model even when the file is PBIX, not PBIP.
TMDLScripts folderStores Desktop script tabs in a projectA script saved here is not automatically applied to the live model.
PBIRStores report layout and configurationA different layer; see the linked report-format guide.

TMDL is human-readable and YAML-like, but has its own grammar. Do not process it as arbitrary YAML or convert indentation casually. DAX/M expressions and object references still have to be valid.

TMSL remains a supported scripting/JSON model representation; TMDL does not replace every TMSL command or XMLA deployment workflow. The practical project choice is a definition folder instead of a monolithic model.bim.

Microsoft reference: TMDL view: GA/preview, Apply/Preview, scope and web differences.

2. Read the files correctly before editing

Sales.SemanticModel\
  definition.pbism
  definition\
    database.tmdl
    model.tmdl
    relationships.tmdl
    functions.tmdl
    tables\
      Sales.tmdl
      Customer.tmdl
    roles\
    cultures\
    perspectives\
  TMDLScripts\
    ReviewedDescriptionChange.tmdl
  DAXQueries\
  .pbi\

This is illustrative: objects/folders exist when the model uses them. A table file typically contains its columns, measures, hierarchies and partitions. Two developers changing measures in the same table can therefore edit the same file. TMDL reduces conflict scope; it does not guarantee a separate file per measure, relationship or partition.

functions.tmdl holds model UDF definitions where present. Use the DAX UDF guide for parameter semantics and saving functions to the model.

Local settings and cache.abf should be excluded as documented; shared editor settings and pending queries have different behavior. Do not add a blanket exclusion for every .pbi file. A project can open without cache.abf, but model metadata alone is not imported source data.

Microsoft reference: Semantic model folders, cache and pending queries.

3. Desktop exercise: one description, preview, apply, verify

  1. Use a practice model with a known measure and trusted result. Save a recoverable baseline.
  2. Open TMDL view. Right-click the measure and select Script TMDL, or drag it from the Data pane.
  3. Change only its description to an owner-approved explanation. Keep its expression, format string, lineage and other properties unchanged.
  4. Select Preview. Inspect the model-level before/after diff, not just the script text. If you edit again, update the preview.
  5. Select Apply. On failure, inspect Problems/Output and the detailed error; do not assume any changes were saved.
  6. Script the object again to read back the description. Rerun its known query/report and inspect the saved project diff.

Pass criteria: exactly the intended metadata change, no changed DAX/security/relationships, and the same known answer. For the actual course orders model, the valid total remains 245.00; an unrelated model has its own expected result.

createOrReplace has object scope. Replacing a whole table with an incomplete definition can remove metadata you did not intend to change. Generate the correct scope from the existing model, inspect the preview and do not paste a generic table replacement over production.

Some properties require a compatibility-level upgrade. Review the prompt and downstream/client compatibility instead of treating Apply as an innocuous text save.

Microsoft reference: TMDL view: GA/preview, Apply/Preview, scope and web differences.

4. Web TMDL: preview, permissions and unsaved scripts

Open the published semantic model’s TMDL View (Preview). The web experience needs Write permission on the semantic model, including to open/use its view mode. Build-only access is not enough.

Web view mode lets you script/preview; edit mode lets you apply changes. Script tabs and contents are not persisted when the model/browser session closes, unlike Desktop tabs. Save reviewed scripts in your controlled project if they are needed later.

The web experience can use workspace model version history for recovery. Confirm the model’s supported web-editing capabilities, underlying connections and granular-access rules from the service editing guide. Do not copy a blanket claim that all TMDL editing requires Premium, or that a historical workspace checkbox is universally required and always off by default.

Applying metadata directly to a service model does not require republishing a report just to change its description. It also does not refresh imported source data, guarantee Direct Lake reframing or repair every report after a rename. Test data freshness and dependent report bindings separately.

Microsoft reference: TMDL view: GA/preview, Apply/Preview, scope and web differences.

5. External changes and the pending-query trap

Current Desktop supports a preview external-change reload workflow on PBIP projects (August 2026 or later, Detect and reload external PBIP changes enabled and Desktop restarted). Save Desktop, edit a supported file externally, save it, then use Apply external changes.

The dedicated external-editing and project-folder pages describe this newer path; older paragraphs in the TMDL view guide still describe restarting to reload. Without the supported reload preview, use the documented reopen workflow. Do not silently assume every installation has hot reload.

If Desktop has unsaved changes, applying external changes overwrites them. cache.abf is not reloaded. If unappliedChanges.json exists, resolve/apply pending Power Query changes before editing model expressions externally; applying those pending queries later can overwrite your external expression changes.

TMDL view Apply, external project reload and data refresh are three different operations. Keep that distinction in the runbook when troubleshooting a model whose definition changed but whose displayed data did not.

Microsoft reference: External PBIP editing and reload preview.

6. Git integration is explicit synchronization, not auto-deploy

  1. Choose an isolated development workspace and repository/branch. Check supported capacity, tenant Git switches, provider access and workspace admin permission for the initial connection.
  2. Connect through workspace Git integration. Review workspace-versus-repository state before the initial sync.
  3. Commit reviewed workspace changes to Git, or edit the checked-out project on a branch and open a pull request.
  4. After merge, deliberately Update from Git or run the approved automation. A repository push is not automatic live-workspace synchronization.
  5. Validate the resulting model, permissions, source connections, refresh and dependent reports before promoting.

A workspace commit is not inherently model-only: eligible changed items, including reports, can be selected. A local Git commit includes what you stage, not automatically both report and model. Keep changes scoped, but include intentionally coupled model/report changes together.

Source control and deployment pipelines solve different problems. A branch name does not bind it to a workspace; configure connections/deployment targets explicitly. Credentials, refresh schedules and environmental settings need their own supported deployment handling.

Use checks for supported model definitions, DAX results, security and source configuration. A Best Practice Analyzer can add useful rule checks if your chosen tool/version supports the format, but it does not prove numerical correctness or replace deployment authorization.

Microsoft reference: Git prerequisites, commits and Update from Git.

7. Advanced properties and AI-assisted changes

TMDL exposes properties such as IsAvailableInMDX, detail-row expressions, perspectives and partition metadata that may lack a convenient graphical editor. Accessibility is not a recommendation to modify every advanced property.

For renaming through TMDL view, script the parent object: a column needs its table; renaming a table needs the model. Review the generated scope and dependencies. A model column’s name and sourceColumn mapping are different; changing a display/model name does not automatically rename a source column in Power Query.

Ask an approved AI agent for a plan and diff, not an unrestricted production rewrite. The MCP guide explains current hosted/local authoring targets and permissions; MCP is not simply a local TMDL file editor. The authoring skills help orchestrate approved model/report tasks.

Before merging, test known answers, changed filters, RLS/OLS identities, report dependencies and a recovery path. Do not claim that a clean text diff or Apply success establishes those results.

Microsoft reference: TMDL view: GA/preview, Apply/Preview, scope and web differences.

Common questions

Do I need PBIP to use TMDL view?

No. TMDL view applies scripts to the model currently open in Desktop, whether saved as PBIX or PBIP. PBIP is useful for source-controlled definition files and saved script tabs.

Is every measure stored in its own TMDL file?

No. Measures generally live with their table in a table definition file. TMDL reduces the scope of diffs and conflicts, but two measures in one table can still involve the same file.

Are Desktop and web TMDL both GA?

Desktop TMDL view is generally available; web TMDL view remains preview. Web use needs model Write permission and its script tabs are discarded when the session closes.

Does a push to Git automatically change my workspace?

No. Commit to Git and Update from Git are explicit synchronization operations, unless approved automation invokes them. A connected branch is not an automatic production deployment.

Does applying TMDL refresh my data?

Not automatically. It applies model metadata. Source refresh, applicable Direct Lake behavior and downstream report verification are separate requirements; a changed expression or partition definition may need further processing.

Official references and review scope

Checked against the following official vendor documentation on 2026-10-30. This is an independent learning guide, not a Microsoft certification, benchmark or customer deployment report. These workflows have not been executed in your tenant. Expected values are teaching acceptance checks; validate feature availability, identity, network, schema, data handling and recovery requirements before production use.

Scroll to Top