How to Create Multiple Measures at Once Using TMDL View in Power BI Desktop

How to Create Multiple Measures at Once Using TMDL View in Power BI Desktop

In today’s blog, we’ll explore a powerful and time-saving feature in Power BI Desktop: creating multiple measures at once using the TMDL view.

If you work with large datasets or enterprise-level reports, then this trick will definitely boost your productivity.


🧠 Why Use TMDL to Create Measures?

Creating measures in Power BI manually one by one can be time-consuming, especially in large datasets or complex models. For example, if you’re building a report that requires 10+ similar measures, switching to the DAX editor for each one can feel repetitive and slow.

Problem with Traditional Method:

  • Click on New Measure
  • Wait for the model to load (especially slow in large datasets)
  • Write the DAX
  • Repeat this process multiple times

Solution: Use TMDL (Tabular Model Definition Language) View to create multiple measures in one go!


🔍 What is TMDL View?

TMDL is a new feature in Power BI Desktop that lets you edit model metadata (like measures, calculated columns, relationships, etc.) using a simple code editor. It’s like having access to the back-end definition of your model, making it much easier to bulk create or edit logic.

📌 If you're new to TMDL, check out my introductory video (link in the description) to get familiar with the interface.

✅ Steps to Create Multiple Measures Using TMDL

Open TMDL View in Power BI Desktop

  • Go to the Model view
  • Click on the TMDL icon from the ribbon

Locate Your Measure Table

  • If you don't have one, create a dedicated Measure Table
  • You can also organize measures using folders

Create One Measure as a Template

  • measure Demo_Measure1 = 1

Add Multiple Measures

  • Press Enter to go to the next line
  • Use the same structure to add more:

measure Demo_Measure2 = 2

measure Demo_Measure3 = 3

measure Total_Sales = CALCULATE(SUM(Sales[Amount]))

Note:

  • Spaces in measure names are not yet supported in TMDL, so use underscores (_) instead.

Click on the “Apply” Button

  • Found on the top-left corner of the TMDL editor
  • All your measures will now be created at once in the model

Article content

💡 Pro Tip

Let’s say you need to calculate sales by categories (e.g., Electronics, Clothing, Furniture). Just create the logic for one:

measure Sales_Electronics = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, Sales[Category] = "Electronics"))

Then copy-paste and change the category name accordingly. Apply the changes, and you’re done!


🎯 Final Thoughts

This method can save a lot of time, especially in enterprise-scale projects or when building demo reports with repeated logic. It’s a great example of how Power BI continues to evolve and empower developers with flexible and efficient tools.


📽️ Watch the Full Tutorial

👉 Click here to watch the full video on YouTube Don’t forget to like, share, and subscribe!

To view or add a comment, sign in

More articles by Anmol Malviya

Insights from the community

Others also viewed

Explore topics