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:
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
Locate Your Measure Table
Create One Measure as a Template
Recommended by LinkedIn
Add Multiple Measures
measure Demo_Measure2 = 2
measure Demo_Measure3 = 3
measure Total_Sales = CALCULATE(SUM(Sales[Amount]))
Note:
Click on the “Apply” Button
💡 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!