Note:
If you switch from DirectQuery to Import, remember to refresh the table so that data loads into the model.
You can use the same approach to switch to other modes like Dual.
Object-Level Security Implementation
Before TMDL, implementing OLS required Tabular Editor or SSMS. Now it can be done directly in Power BI Desktop.
Below is an example that creates a role called RestrictEmployeeId and hides the employeeId column in the Employee table:
Another example that hides the entire Employee table:
Write your own script based on your model and run it in the TMDL view.
You can see the created roles in Model Explorer.
Creation of Perspectives
If you have used the Personalized Visuals feature, you may already know what Perspectives are. They are used to provide a simplified, focused view of a model.
Earlier, creating perspectives required Tabular Editor. TMDL now supports it directly.
The example below creates a perspective called EmployeePerspective that includes selected columns from two tables:
Run a similar script based on your model in the TMDL view.
Your perspective will appear in Model Explorer.
Addition of Cultures and Translations
If you have created multi-language Power BI reports, you may already know about Cultures.
Previously, adding a new language or translation required Translation Builder or Tabular Editor. With TMDL, you can define cultures directly.
Example: Adding Spanish (es-ES) language and translating several objects:
Run the script in the TMDL view.
The culture will appear in Model Explorer.
Configuration of Detail Rows Expressions
If you build self-service datasets for Excel users, you may already know about Detail Rows. This property controls exactly which columns are returned when users drill through in Excel PivotTables connected to your Power BI semantic model.
Before TMDL, setting this property required Tabular Editor. Now it can be done in Desktop.
The example below creates a measure EmployeeCount and defines a Detail Rows expression for it:
Run this script in the TMDL view.
To validate the property, you can run a DAX query:
EVALUATE DETAILROWS([EmployeeCount])
Creating Custom Table Partitions
Before TMDL, splitting a table into custom partitions required Tabular Editor or other external tools. Now this can be done directly in Desktop.
Script your table into TMDL view, locate the partition section, and modify it as needed.
Example: Splitting the Employee table into two partitions:
Run the script in the TMDL view.
You will see the new partitions under the table in Model Explorer.
Note: After updating the partitions, refresh the data in the table.
I hope you find this information useful, If I missed any other TMDL capabilities that were not possible through the Power BI Desktop GUI, please share them with me.
Happy Learning!