What is a PBIP project, and what is TMDL?

Power BI

A Power BI project (PBIP) saves a report and its semantic model as plain text files in folders, instead of one .pbix file. TMDL is a text format for the model, with a file for each table.

What a PBIP is

When you save your work as a Power BI project, Power BI Desktop writes the report and the semantic model as separate plain text files in a folder. Microsoft documents the files, and you can read them, so you can review changes and keep them in Git.

You convert in Power BI Desktop with File > Save as, in either direction: a .pbix to a PBIP, or a PBIP back to a .pbix.

Source: Power BI Desktop projects (PBIP).

What is in the folder

  • [name].pbipa shortcut to the report folder. It is optional. You can open the definition.pbir in the report folder instead.
  • [name].Report/the report. Its definition.pbir holds the core settings and the reference to the semantic model.
    • definition.pbir
    • .pbi/
  • [name].SemanticModel/the semantic model. Its definition.pbism holds the core settings.
    • definition.pbism
    • .pbi/
      • cache.abf
  • .gitignorewritten by Power BI Desktop when the folder or its Git repository has none. It keeps localSettings.json and cache.abf out of Git.

.pbi/ folders: settings for your own computer, editor settings shared with others, and in the model, cache.abf, a local copy of the model and its data.

RP_Report01.Report/definition.pbir: the report finds its model by a relative path.
{
  "version": "4.0",
  "datasetReference": {
    "byPath": {
      "path": "../SM_SalesSense.SemanticModel"
    }
  }
}

From the SalesSense sample project by Rui Romano (MIT licence).

Source: Power BI Desktop projects (PBIP), Power BI Desktop project report folder, Power BI Desktop project semantic model folder.

What TMDL is

TMDL (Tabular Model Definition Language) is a text format for tabular models. It reads a little like YAML: each object is declared on its own line, and indentation shows what belongs to what.

A PBIP saved in TMDL keeps the model in the definition folder of the semantic model, with a separate file for each table, role, culture and perspective. The other format, TMSL, keeps the whole model in one JSON file, model.bim.

A definition.pbism at version 4.0 or above allows either format. Version 1.0 requires model.bim.

One column in tables/Product.tmdl: the declaration, then its properties one tab deeper.
	column Manufacturer
		dataType: string
		lineageTag: 59e45f50-f68d-44c3-becd-70ccd5a7eb7d
		summarizeBy: none
		sourceColumn: Manufacturer

		annotation SummarizationSetBy = Automatic

From the SalesSense sample project by Rui Romano (MIT licence).

Source: Tabular Model Definition Language (TMDL), Power BI Desktop project semantic model folder.

The TMDL rules that trip people up

  • Indentation is one tab per level. An object declaration is level 1, its properties level 2, and a multi-line expression level 3. Breaking the rule is a parsing error.
  • A name with a dot, an equals sign, a colon, a single quote or a space goes in single quotes, and a single quote inside the name is written twice.
  • A property value stays on the same line as its colon.
  • A line that starts with /// above an object is its description.

When a file breaks these rules, Power BI Desktop shows one of these:

Source: Tabular Model Definition Language (TMDL).

Editing the files outside Power BI Desktop

You can edit TMDL files in VS Code while the project is open. Save your work in Power BI Desktop first. It then offers to apply the external changes, and warns you if that would overwrite unsaved work.

Some files do not support editing outside Power BI Desktop: the legacy report.json at the root of the report folder, mobileState.json and semanticModelDiagramLayout.json in the report, and diagramLayout.json in the model.

TMDL view, the TMDL editor inside Power BI Desktop, is generally available. On the web it is in preview.

Source: Power BI Desktop project semantic model folder, Power BI Desktop projects (PBIP), Work with TMDL view in Power BI Desktop.

Check a project in your browser

The Power BI Report Doctor reads a PBIP folder or .zip and lists the file and line to fix. Nothing is uploaded.

Other guides

Sources

Your JSON and text are processed entirely in your browser and are never sent anywhere. To understand how the site is used we record each page view (the page, the referrer and an approximate location from your IP address) and keep it for 90 days. Nothing is stored on your device unless you choose it. Accept to also store a device identifier here and record your browser and device characteristics, which is what lets a return visit be told from a new one. Decline and nothing is sent at all. We respect Do Not Track. See our privacy policy.