Stop Rewriting DAX: Build Your DAX Dictionary with TMDL
How TMDL Can Be a Single Source of Truth for DAX Logic
One of the biggest pain points in large Power BI ecosystems is DAX duplication. Every report author ends up writing the same time intelligence logic, KPI calculations, or currency conversions slightly differently.
This leads to:
Inconsistent metrics across teams
Hard-to-maintain logic spread across many
.pbix
filesLack of visibility into what formulas are used where
But what if we never had to rewrite DAX again?
Enter TMDL: The Encyclopedia of Enterprise DAX
With Tabular Model Definition Language (TMDL) now part of Power BI Desktop, you can store your calculation groups, measures, and model logic in readable text files.
These .tmdl
files can be:
Version controlled using Git
Reviewed via pull requests (just like code)
Used as a standard reference library for all BI teams
Imagine your team having a TMDL repo structured like this:
/enterprise-models
├── time-intelligence/
│ └── time_calc_group.tmdl
├── finance/
│ └── gross_margin.tmdl
├── sales/
│ └── net_sales.tmdl
Now, whenever someone needs a YTD metric or gross margin calc , they pull it from the shared TMDL reference, not rewrite it.
TMDL as an Enterprise Data Product in Your Data Mesh
One of the exciting things about adopting TMDL in Power BI is how it fits perfectly into the Enterprise Data Mesh architecture. When you think of your reusable DAX logic like calculation groups, measures, time intelligence as standardized, version-controlled assets, they naturally become data products in their own right.
This means:
Your Centre of Excellence (CoE) team within the Enterprise Data Mesh setup can take ownership of this DAX dictionary or repository.
They will maintain, govern, and improve these shared DAX assets, ensuring consistency and quality across business units.
Just like other data products, these calculation logic files (
.tmdl
) are discoverable, reusable, and versioned making them trustworthy building blocks for all your BI teams.
This elevates DAX logic from scattered reports to centrally managed, enterprise-grade assets that enhance collaboration and reduce duplication.
In essence, your TMDL repo becomes a data product maintained by the CoE team of your Enterprise Data Mesh System (EDMS). This is a major step towards embedding analytics engineering principles in your BI ecosystem, driving governance, reusability, and agility.
What You Can Do Today
Enable TMDL View in Power BI Desktop (Preview Feature)
Start creating Calculation Groups in Tabular Editor (or soon, directly in Desktop)
Use Git to track changes to your
.tmdl
filesSet up a shared enterprise repo for reusable logic
Start small — maybe just your Time Intelligence logic, and grow from there
Power BI is Evolving — TMDL is a Game Changer
Power BI is no longer just a report builder. It’s becoming a true enterprise modeling platform, and TMDL is a key part of that shift. If you’re a DAX-heavy user who wants to reduce duplication and enforce consistency, this is for you.
Let’s Walk Through Three Core Areas:
1. What Are Calculation Groups — and Why Use Them?
Calculation Groups allow you to define reusable logic for measures, dramatically reducing the amount of repeated DAX in your model.
Instead of rewriting similar measures like:
Total Sales LY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Date[Date]))
…for every metric, you define a calculation group with items like Last Year, MTD, YTD, etc.
Benefits:
Reduces clutter in your model
Promotes consistency across reports
Makes your model easier to maintain and extend
You can create these in Tabular Editor and soon, directly from Power BI Desktop using TMDL view.
2. What is the TMDL View in Power BI Desktop?
The TMDL View is a new modeling layer in Power BI Desktop (still in preview) that exposes your semantic model as structured, readable text.
This means you can:
View and edit your model using code, similar to JSON or YAML
See clear definitions for tables, relationships, measures, and calculation groups
Track and version changes using Git or other DevOps tools
This aligns perfectly with modern DevOps and data mesh workflows.
As Rui Romano recently pointed out, the TMDL View makes it super easy to reuse and share semantic model objects across different semantic models.
To support this, Microsoft has launched an official TMDL Gallery in the Fabric Community — a central place where you can discover and share your favorite semantic model objects as TMDL scripts, making it simple for everyone to reuse these assets.
Check out the TMDL Gallery here: https://lnkd.in/dnzTn4gQ
To enable it:
Go to File > Options > Preview Features
Enable "TMDL (Tabular Model Definition Language) View"
Restart Power BI Desktop
3. Deep Dive into TMDL: What Can You See?
Once enabled, you'll notice a new "Model" view that shows:
.tmdl
files for each table and calculation groupStructure of each object in clear, readable text
Dependencies and relationships across measures and models
Sample .tmdl
snippet for a calculation group: it’s clean, easy to track, and portable.
calculation group 'Time Intelligence' {
description = "Reusable time-based calculations"
calculation items = [
item 'YTD' {
expression = CALCULATE(SELECTEDMEASURE(), DATESYTD('Date'[Date]))
},
item 'LY' {
expression = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date]))
}
]
}
TMDL as the Encyclopedia of DAX?
Imagine every enterprise team maintaining their reusable calculations as .tmdl
files in a shared Git repo. You:
Review DAX logic just like reviewing code
Avoid rewriting logic for every model
Build trust in calculations across teams
It’s like turning your model into a declarative, version-controlled DAX dictionary.
Final Thoughts
TMDL brings structure, reusability, and engineering discipline to your Power BI ecosystem. Whether you’re in a data mesh, federated BI setup, or DevOps-driven team —start small with TMDL, and scale gradually. Your future self (and your entire BI team) will thank you.
Give it a try. Turn your DAX logic into enterprise assets.
Want to Learn More? Here Are Some Great Resources on TMDL
To help you dive deeper into TMDL and make the most of this powerful new feature, here’s a quick summary and some useful links:
Summary:
TMDL View is transforming how Power BI models are created, managed, and shared by turning your semantic model into structured, version-controllable text. It boosts productivity by enabling reuse, standardization, and collaboration across teams. You can script your model, use Git for versioning, and even leverage galleries to share reusable calculation logic. Whether you’re an analytics engineer, BI developer, or enterprise architect, understanding and adopting TMDL will future-proof your Power BI projects.
Recommended Resources:
Five Ways That the TMDL View Can Help You Be More Productive in Power BI — Tabular Editor Blog
Unlocking Efficiency with TMDL View in Power BI — BI4ALL Consulting