ErrorIn a TMDL file1 cause · The Report Doctor detects none yet.

TMDL Format Error: Invalid indentation was detected!

Power BI

The message, 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]'

What it means

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.

Usually
A property is not indented under its object
Fix
Open the file named in Document and go to the line it gives.
On this page

How the message appears

Copied exactly from each source.

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.[1]

Read it in this order

  1. Parsing error typeThe clue to the cause. Indentation points to cause 1, a property is not indented under its object.
  2. DocumentThe file to open.
  3. Line NumberThe line to go to in that file.
  4. LineThe line as Power BI Desktop read it.

What causes it

  1. 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[1].

    The Report Doctor doesn't detect this yet.

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

Line 2: add a tab.

Fixed
database
	compatibilityLevel: 1601

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

The Power BI Report Doctor does not find a property that is not indented yet.

Other messages that stop a project opening, by the file that causes each: Power BI Desktop can't open a PBIP.

Worth knowing

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

Sources

Did this page help?

It tells us which pages to fix first.

What you put into the tools never leaves your browser. We count page views and keep them for 90 days. Accept and we also remember this browser, so a return visit is not counted as new. Privacy policy