03.09.2025
What Is TMDL view in Power BI Desktop?
TMDL stands for Tabular Model Definition Language. In Power BI Desktop, the TMDL view provides a way to explore and edit your data model in a more structured, code-like representation. Instead of just working with drag-and-drop interfaces, TMDL exposes the underlying model definitions, allowing users to make precise adjustments.
Think of TMDL as a text-based representation of your semantic model. It shows all the objects in your model tables, relationships, measures, hierarchies, perspectives, and more in a format that is easier to read, modify, and version-control.
Use Cases of TMDL View
Model Transparency – You can easily inspect the full structure of your model in one place without clicking through multiple menus.
Version Control – Since TMDL is text-based, it can be stored in source control systems like Git, helping teams collaborate better and track changes.
Bulk Edits – Quickly update multiple objects (like renaming columns, measures, or tables) without needing to adjust them one by one in the UI.
Learning & Documentation – TMDL helps users understand how their semantic model is structured, which makes it a great tool for documentation.
Reusability – You can copy and reuse parts of the TMDL code across different projects.
How to enable preview feature
To use TMDL view, you must enable the preview feature. In Power BI Desktop select File > Options and settings > Options > Preview features and select the box next to TMDL View.
Let's do some Simple Model Adjustments with TMDL View
Here are a few simple adjustments you can make using the TMDL view in Power BI Desktop:
Rename Tables and Columns – Instead of clicking through each table, just edit the name directly in the TMDL code.
Let's see how we can acheive that in TMDL view. First you need to go to TMBL tab from PBI Desktop in left corner. Then go to right pane right click on semantic model and click the script TMDL to scipt tab. Refer the below image.
Use the replace function to update all occurrences of the table name, then apply the changes. After that, refresh the data. To open command palette press CTRL + ALT + P , You’ll then see all the available options. Refer the below image.
Change Data Types - Adjust column data types directly in the TMDL definition. We can use the same replace function to replace data types of columns.
Adjust Hierarchies – Easily reorder or add new levels to hierarchies in your model. Simply drag and drop the available hierarchies to make changes, such as removing a specific column, and then click Apply.
Now we have come to the end of this blog post. I hope you have a basic idea of the TMDL view in Power BI Desktop. Starting with the fundamentals, we explored what TMDL is, why it’s useful, and some practical steps like renaming tables and columns. The TMDL view bridges the gap between visual and code-based modeling, making your work more efficient, transparent, and easier to maintain.
As you continue working with Power BI, try experimenting with TMDL for small adjustments first. Over time, you’ll see how it can streamline your workflow, improve collaboration, and give you more control over your models.