TMDL Format Error: Invalid indentation was detected!
Power BIThe 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]'
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
Documentand go to the line it gives.
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'
Read it in this order
Parsing error typeThe clue to the cause. Indentation points to cause 1, a property is not indented under its object.DocumentThe file to open.Line NumberThe line to go to in that file.LineThe line as Power BI Desktop read it.
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
compatibilityLevelstarted at the beginning of the line underdatabase, and Power BI Desktop reportedIndentationon line 2. The issue's author says this stopped the semantic model from loading, and thatreflines undermodelare 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:
database
compatibilityLevel: 1601Line 2: add a tab.
database
compatibilityLevel: 1601From 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
- [1]GitHub issue: alessandrorapitiagic/retail-data-platform-copilot-lab issue 3. The issue description, "Problema" and "Causa". Read 2026-10-04.
Did this page help?
It tells us which pages to fix first.