· 

Speed up with TMDL Preview feature - Jan 25 Update

 

The DAX Query View has already proven to be a game-changer for streamlining batch editing directly within Power BI.

 

With the January 2025 update, Microsoft has taken this functionality even further. You can now edit and apply changes to your measures directly in Power BI TMDL View, making the process faster and more efficient.

 

Previously, in the DAX Query View, you could only access the DAX expressions. However, in the new TMDL view, you can now modify not just the DAX code but also:

  • Format options
  • Folders
  • Storage modes of tables

This makes the TMDL view a more comprehensive solution for managing your data model in Power BI and streamlinign the process. 

What is TDML?

TMDL (Tabular Model Definition Language ) is a scripting language designed for working with tabular data in tools like Power BI. It allows you to create and update tables, measures, and relationships directly in the data model. TMDL is especially helpful for automating tasks and keeping your data workflows flexible and efficient.

Enable TMDL within Power BI

First step is to enable it within Power BI. Go to File >Options and Settings > Options > Preview Features.

Scripting Options

By clicking on the three dots next to a measure or table, you’ll see two options:

  • Script to Tab: Displays the TMDL code in the opened tab (Alternative to draggin the measure in)
  • Script to Clipboard: Copies the TMDL code for the measure, allowing you to paste it into another model or a text editor.

Use TDML to modify your Measures

If you go to the TMDL view you can also drag in one or several measures by selecting them while clicking on them and pressing SHIFT.

Here, I’ve dragged a measure. In the TMDL view, you can see:

  • How the measure is calculated
  • Which format option is applied
  • In which folder it is stored

Additionally, you can view the lineage tag of the measure. This serves as a unique identification key within the semantic model.

 

In the TMDL view, you can easily modify the DAX calculation, change the format option, or update the folder where the measure is stored, and apply these changes to the model my clikcing "Apply".

 

You can also use Ctrl + F to find and replace text within this view.

This is how it looks like when you used Ctrl + SHIFT to drag in multiple measures

Use TMDL to modify your tables

If you script a table to tab you will see the following definitions:

  • lineageTag: A unique identifier for tracking the column within the model.
  • dataType: Defines the data type (e.g., dateTime, string, int64).
  • formatString: Specifies the display format for data (e.g., Long Date, 0).
  • summarizeBy: Defines how the data should be aggregated (e.g., none, sum).
  • sourceColumn: Points to the original source column from which the data is derived.
  • annotation: Additional properties or settings applied to the column (e.g., SummarizationSetBy to indicate automatic summarization, UnderlyingDateTimeDataType to define date-time behavior)

Furthermore there are also definitions on the storage mode in Power BI: 

  • mode: Specifies the data import method (e.g., import mode).
  • source: Defines the source query to retrieve the data (e.g., from an Excel file using Excel.Workbook and Table.PromoteHeaders).
  • annotation: Additional metadata for the partition, such as PBI_ResultType = Table, which indicates the result type of the operation.

There’s also another big improvement now! In earlier versions of Power BI, once a table was set to Import mode for data loading, it wasn’t possible to switch it back to DirectQuery mode directly within the Power BI interface. To switch from Import to DirectQuery, you typically had to recreate the table or data source connection.

 

With the TMDL View it is now possible to change the Import mode in TMDL.

  • Change the mode from Import to DirectQuery.

Summary

I hope you are as excited as I am about the new Power BI feature! 😍 It’s a great way to manage tables, columns, and measures directly within Power BI without switching to external tools.

 

You can use it to batch edit measures, modify tables and measures, and optimize the streamlining of your process. I hope you’ll definitely give it a try!

If you prefer a video, you can also watch the TMDL Introduction on YT - BI Vibes

More Posts you might enjoy

😍 Turning ON and OFF Stacked Bars without bookmarks

😍 SVG Progess Bar with Chat GPT


Write a comment

Comments: 0