
If you want to hear a collective groan in a room full of BI Developers, just say the words: „We need to update the data dictionary.”
Nobody likes writing documentation. In the fast-paced world of Enterprise BI, manually typing out table descriptions, listing DAX measures, and drawing relationship schemas in a Word document or Confluence page is a soul-crushing exercise. Worse, it’s completely futile. By the time you get the PDF signed off by stakeholders, a developer has already added three new measures and changed a relationship cardinality.
Your documentation is obsolete the second you hit „Save”.
But it doesn’t have to be. Your Power BI semantic model already contains its own documentation. You just need to know how to extract it.
The Paradigm Shift: Your Model is Just Text
With the introduction of the Power BI Project format (.pbip) and the underlying TMDL (Tabular Model Definition Language) or the legacy .bim (TMSL) files, Microsoft gave us a massive gift. A semantic model is no longer a locked black box. It is an open, hierarchical structure of plain text and JSON.
If it’s plain text, we can query it. And if we can query it, we can use Power Query to parse our own model and generate the documentation dynamically.
The Logic: Parsing the .bim File
Let’s look at how you can start extracting your Data Dictionary programmatically. If you save your semantic model as a .bim file, it’s essentially a giant JSON document.
You can spin up a blank Power BI report, open Power Query, and write a script to crack open that JSON and extract your physical tables:
let
// 1. Point to your local folder containing the model.bim
FolderPath = "C:\Your\Project\Path",
BimFilePath = FolderPath & "\model.bim",
// 2. Load the JSON document
SourceJSON = try Json.Document(File.Contents(BimFilePath)) otherwise Json.Document("{}"),
ModelNode = try SourceJSON[model] otherwise null,
// 3. Navigate to the tables node and convert it to a list
TablesNode = try ModelNode[tables] otherwise {},
ConvertedTables = Table.FromList(TablesNode, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// 4. Expand the core metadata properties
ExpandedTables = try Table.ExpandRecordColumn(
ConvertedTables,
"Column1",
{"name", "dataCategory", "partitions"},
{"TableName", "DataCategory", "Partitions"}
) otherwise #table({"TableName", "DataCategory", "Partitions"}, {})
in
ExpandedTables
With just a few lines of M-code, you instantly have a live connection to your model’s architecture. Every time you refresh this report, it reads the latest state of your tables.
The Hard Part: Stitching the Architecture Together
Extracting table names is the easy part. The real engineering challenge begins when you try to build a complete, client-ready specification.
To create a true automated Data Dictionary, you have to:
- Extract the multi-line M-code from the
partitionsnode. - Flatten complex DAX expressions and Row-Level Security (RLS) filters from the
rolesnode. - Reconstruct the entire relationship graph (handling implicit single/many cardinalities).
- Filter out the auto-generated Power Query helper files (the dreaded „Transform Sample File” artifacts).
Building this extraction engine from scratch takes weeks of deep Power Query and DAX engineering.
Automate the Output
This is exactly why I built ModelLens under theBItoolbox. I was tired of spending days manually updating Word documents for clients.
ModelLens handles the complex parsing engine out of the box. It extracts your entire .pbip or .bim architecture natively into Power BI matrices.
More importantly, it solves the „business context” problem. Code can’t tell you why a dashboard was built. ModelLens uses a unique Red-Bracket UX—visual prompts like <color="#FF0000">[Insert Project Purpose Here]</color> directly on the canvas. You open the .pbit, fill in the subjective business details in 15 minutes, hit „Export to PDF”, and you have a pixel-perfect, fully updated architectural specification ready for sign-off.
Stop doing manual data entry. Start parsing your metadata.
Check out how the ModelLens extraction engine works here:
https://thebitoolbox.gumroad.com/l/modellens
