Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Power BI continues to evolve, offering powerful tools that enhance the data modeling and visualization experience. One of the latest additions to Power BI Desktop is the TMDL View (Tabular Model Definition Language), a feature currently in preview. This game-changing tool allows developers to script, modify, and apply changes to semantic models directly through code. In this blog, we'll dive deep into the functionalities of TMDL View, its benefits, and how you can leverage it to supercharge your Power BI projects.
To get started with TMDL, you’ll need to enable it in the Preview features of Power BI Desktop:
Once the preview feature is enabled, the TMDL view tab will appear on the left side of the Power BI Desktop window:
Even if you're not looking to modify your semantic model, TMDL View is a powerful tool for exploring and understanding model metadata. You can explore any particular measure, column, table or complete Semantic Model. You can either drag and drop the field to the space or simply right click on it and select script tab
By clicking on this you wil be able to see the complete summary of the field as below
TMDL View’s code editor isn’t just for scripting—it’s a comprehensive development environment. Key features include:
For example, if you need to remove prefixes like "dim_" or "fact_" from all your tables, you can script the full model, search for these prefixes using regular expressions, and replace them in bulk.
Once your scripts are ready, simply click the Apply button to execute the changes. Successful changes trigger a confirmation notification, while errors prompt a detailed diagnostic message, guiding you through troubleshooting steps.
It’s important to note that TMDL View only modifies semantic model metadata—it doesn’t refresh data or impact report visuals unless those changes directly affect them. For example, renaming a field might break existing visuals that rely on that field.
TMDL view isn't just about scripting; it's about transforming how you manage and interact with your semantic models. Here are some practical use cases:
1. Bulk Move Measures into a Folder
Organize your measures effortlessly by scripting them into specific folders, enhancing model clarity and navigation.
2. Update M-Code Without Query Editor
Modify your Power Query M-code directly through TMDL scripts, bypassing the query editor for quicker updates.
3. Change Data Types
Easily adjust the data types of your columns using simple TMDL commands, ensuring consistency across your model.
4. Update Summarization at Once
Apply summarization changes to multiple columns simultaneously, saving time and reducing manual errors.
5. Find and Replace
Use the search-and-replace functionality to quickly update naming conventions or correct errors across your model.
6. Switch Between Import and Direct Query
Toggle your data connection modes from Import to DirectQuery or vice versa using TMDL scripts.
7. Import and Collaborate Using TMDL Scripts
Share your TMDL scripts with colleagues via email or platforms like SharePoint, promoting collaborative development.
8. Create Calendar Tables and Calculation Groups
Generate calendar tables and calculation groups directly in TMDL, streamlining time intelligence functions.
9. Utilize Multiple Cursors
Speed up your coding process with multiple cursors, allowing simultaneous edits in different parts of your script.
In upcoming blogs we will share detail about each use case in detail.
TMDL View in Power BI Desktop is a powerful addition that opens new doors for developers and analysts alike. Whether you're looking to enhance efficiency, improve model transparency, or collaborate seamlessly with your team, TMDL View offers the tools you need.
Stay ahead of the curve by enabling this feature today and exploring its vast potential. And don’t forget—we’d love to hear your thoughts and experiences! Share your feedback through the Power BI Community and help shape the future of Power BI.
Ready to dive in? Enable TMDL View in Power BI Desktop and start scripting your way to more efficient data models!
Proud to be a Microsoft Fabric community super user
Let's Connect on LinkedIn
Subscribe to my YouTube channel for Microsoft Fabric and Power BI updates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.