TMDL Format Error: Invalid indentation was detected!

Power BI

TMDL reads the lines under an object declaration as that object's properties. Power BI Desktop found a line whose indentation does not fit the line above it. The dialog names the file in Document and the line.

How the message appears

Copied exactly from each source. A name in square brackets replaced one from someone else's project.

TMDL Format Error:
	Parsing error type - Indentation
	Detailed error - Invalid indentation was detected!
	Document - './database'
	Line Number - 2
	Line - 'compatibilityLevel: 1601'
GitHub issue: alessandrorapitiagic/retail-data-platform-copilot-lab issue 3. Read 2026-10-04.

In general form, with the parts that change in brackets:

TMDL Format Error: Parsing error type - Indentation Detailed error - Invalid indentation was detected! Document - '[file]' Line Number - [n] Line - '[line]'

The fix

Open the file named in Document and go to the line it gives. Indent each property of that object by one tab, so it sits under the line that declares the object. Check the other properties of the same object, because the message stops at the first one.

In database.tmdl:

Broken
database
compatibilityLevel: 1601
Fixed
database
	compatibilityLevel: 1601

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

What causes it

A property is not indented under its object

A property of an object has to be indented one tab from the line that declares the object. In the quoted case compatibilityLevel started at the beginning of the line under database, and Power BI Desktop reported Indentation on line 2. The issue's author says this stopped the semantic model from loading, and that ref lines under model are the exception and take no tab.

Source: alessandrorapitiagic/retail-data-platform-copilot-lab issue 3.

The Report Doctor doesn't detect this yet.

Worth knowing

  • Most editors can show whitespace. A property that starts at the left edge under an object line is the sign.

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.

Sources

Written by Vishnu Shankar.

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.