This summary is produced by the author, and not by AI.
The TMDL view is a new feature in Power BI Desktop that has a lot of potential. This feature lets you directly change model metadata without dependency on the user interface of Power BI Desktop. By making changes to the model metadata directly, you can scale your tasks within a model to be more efficient and do things that previously weren’t possible without third-party tools.
If you want a complete introduction to the TMDL view and how to use it, we recently released a free course that you can follow via Tabular Editor Learn. However, if you just want a short overview of some ways that this feature can save you time, we list out five use-cases in this short article. This article is just meant to get the gears turning in your mind, so that you can see the value in the TMDL view for your own scenarios.
The TMDL view is a separate view in Power BI Desktop, like the DAX query view, the report canvas, and so on. To use the TMDL view:
Step 1: Ensure that it’s enabled from the preview features in Power BI Desktop.
Step 2: Navigate to the “TMDL view” on the left-hand side of the user interface.
Step 3: Select one or more objects in your model (tables, columns, measures) from the data pane or the “semantic model” pane.
Step 4: Click and drag these objects onto the TMDL canvas to make a new script.
Step 5: Make changes to the metadata and click “preview” to see your changes. Check for any unexpected changes highlighted in that preview “diff” on the right.
Step 6: Apply your changes to the model.
In addition to the above, you might also consider using the TMDL view in combination with other tools, like Tabular Editor 3 (which can generate TMDL scripts) or VS Code (which can open TMDL scripts from a Power BI Project and use GitHub Copilot):
Here’s a quick overview of five example use-cases for the TMDL view, when you use Power BI Desktop:
The most obvious and simple way that the TMDL view can be useful for you is that you can make multiple changes at once. Importantly, to do this, you must know the basics of how to read and interpret TMDL metadata. Thankfully, TMDL is elegantly structured, making it easy to read and change, even for novice or intermediate users of Power BI.
This is important to emphasize: The TMDL view is so simple and straightforward that it’s accessible to a wide range of Power BI users… not just experts! This feature is an on-ramp for enhanced productivity for anyone who works in Power BI. They just need to know when to use it and why it can be helpful for them.
Since you are just working with metadata as text, you can use various text / code editor tools and shortcuts to streamline these changes. Here are some simple examples:
Ctrl + F to search a script for text (strings and substrings). This can be useful when you are checking for measure references, functions, or keywords, or if you want to replace these substrings with other values. Alt and select another part of the script to create a second cursor. You can do this multiple times to edit multiple parts of the script at once, rather than performing a find-and-replace. Further, you can also press Ctrl + D to select the next occurrence of a word at the cursor, or Ctrl + Shift + L to select all occurrences. These shortcuts also work in the Power BI Desktop DAX formula bar.Think about using the TMDL view for this use-case in the following scenarios:
TODO).We discussed this in a previous article, but there are many features and properties in Power BI that aren’t supported by the user interface. Developing a user interface to support these things takes time and priority which Microsoft doesn’t necessarily have, so users needed to rely on third-party tools, instead. However, it’s now simple to change these properties via the TMDL view, notebooks, or even VS code.
You can use the TMDL view whenever you want to leverage these properties, and aren’t using third-party tools, either due to preference or organizational restrictions. Here are some simple examples:
IsPrivate or IsAvailableInMdx. Only a small subset of object properties are shown in the user interface in Power BI. There are many other properties that you can use for various purposes; IsPrivate will hide a table from client tools, while IsAvailableInMdx will make columns occupy less memory, but make them inaccessible to MDX queries from tools like Analyze-in-Excel.Note that you don’t need to use these properties; they often come up when you have a specific requirement or scenario that they would support.
Power BI Desktop is a big tool that can do a lot of things. Consequentially, it can be a bit heavy, and some operations take a lot of time to complete. When you need to check or search for things in your model, this can cost you a lot of time over the lifecycle of a project or a model. An example of this is when you transform data in Power Query, and you regularly must open the query editor to check or change transformations.
In the TMDL view, you can view these transformations for table partitions much quicker and more conveniently than using the query editor.
Here are some simple examples:
Note that when you use the TMDL view for Power Query, you accept the following caveats:
A common use-case of generative AI is to help you make changes to code and text, such as TMDL metadata. Since TMDL scripts are saved in a Power BI Project file, it is easy to open them in VS Code and make changes via GitHub Copilot. Here, you can prompt the tool to make various changes or additions to your model, including names, properties, and code. Note however that you will only see and validate these changes once you open the Power BI Project in Power BI Desktop.
Here are some simple examples:
Note that AI models aren’t trained on very much TMDL data, since the TMDL format is relatively new. Therefore, you should make sure that you provide ample examples to an LLM if you want it to generate TMDL or make significant changes to your script.
You typically want to reuse as much of your models and reports as possible in future work. This means that you follow the principles of atomic design, and take steps to create and use templates in a repeatable and sustainable way. TMDL scripts are one modality to do this for static templates, meaning templates that do not have dynamic or parameterized elements that change depending on the target model.
There are other ways to save and reuse templates, including dynamic templates:
Templates are one of the most valuable assets in your Power BI ecosystem. Here are some simple examples:
Irrespective of the approach you choose, it is most important that you actively and regularly look for opportunities to create and use templates in your work.
The TMDL view is a powerful new tool that can help you scale tasks when you develop a semantic model. It’s a useful and easy way to make changes in bulk or access parts of the model that weren’t possible before without third-party tools. Furthermore, it helps to familiarize users with model metadata and also approaches that work beyond the user interface for enhancing productivity and development, so that they can leverage other tools like notebooks, C# scripts in Tabular Editor, and more.
This article introduces just five possible use-cases… there are more! If you want to learn the details of the TMDL view, check out our free course via Tabular Editor Learn.
Take your semantic models further with Tabular Editor.
Give Tabular Editor a spin