TMDL Format Error: Invalid indentation was detected!
Power BITMDL 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'
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:
database
compatibilityLevel: 1601database
compatibilityLevel: 1601From 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
- GitHub issue: alessandrorapitiagic/retail-data-platform-copilot-lab issue 3. The issue description, "Problema" and "Causa". Read 2026-10-04.
Written by Vishnu Shankar.