Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
anmolmalviya05
Super User
Super User

How to change source table of measures in TMDL View

Hi Everyone, I'm exploring the TMDL view and checked the displayfolder function which is super helpful to change folder of multiple measures at a single time, but i'm unable to figure out how we can change the source table of measures using TMDL view. Is there any function or command using which we can change source table of measure using TMDL view

1 ACCEPTED SOLUTION
v-jtian-msft
Community Support
Community Support

Hi,@anmolmalviya05 .I am glad to help you.
This is my test:

Unfortunately, for the time being, I have not been able to find a command in TMDL View to batch modify the original form names of multiple measures.

I used the createOrReplace command to modify the information for a single measure (created a new measure and renamed it)

vjtianmsft_0-1738898271286.png

In the officially provided documentation, there is currently only the createOrReplace command.

TMDL scripts | Microsoft Learn

vjtianmsft_1-1738898317131.png

 

Maybe you could achieve a similar effect in other ways: batch change the source table name of the measure to realize the move of the measure to other tables for management.
URL:
Solved: How to move measure from folder to out of folder ? - Microsoft Fabric Community
 

Or use the modify command in DAX VIEW
The approach is as follows:

Prepare code in Excel: write repetitive DAX code in Excel. Example:

DEFINE
MEASURE 'table'[Measure1] = SUM('Fact_Sales'[quantity])
MEASURE 'table'[Measure2] = SUM('Fact_Sales'[amount])
...
MEASURE 'table'[MeasureN] = SUM('Fact_Sales'[value])


Copy and Paste to DAX Query View window: copy the code from Excel and paste it into Power BI's DAX Query Window. Perform Unified Processing.

vjtianmsft_2-1738898423887.png

 


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jtian-msft
Community Support
Community Support

Hi,@anmolmalviya05 .May I ask if you have  found the relevant command or code later?
If your problems have been solved correctly (or other ways have been used as alternatives), you can share them. Thank you for your support of Power BI. Good luck with your work.
Best Regards,
Carson Jian

v-jtian-msft
Community Support
Community Support

Hi,@anmolmalviya05 .I am glad to help you.
This is my test:

Unfortunately, for the time being, I have not been able to find a command in TMDL View to batch modify the original form names of multiple measures.

I used the createOrReplace command to modify the information for a single measure (created a new measure and renamed it)

vjtianmsft_0-1738898271286.png

In the officially provided documentation, there is currently only the createOrReplace command.

TMDL scripts | Microsoft Learn

vjtianmsft_1-1738898317131.png

 

Maybe you could achieve a similar effect in other ways: batch change the source table name of the measure to realize the move of the measure to other tables for management.
URL:
Solved: How to move measure from folder to out of folder ? - Microsoft Fabric Community
 

Or use the modify command in DAX VIEW
The approach is as follows:

Prepare code in Excel: write repetitive DAX code in Excel. Example:

DEFINE
MEASURE 'table'[Measure1] = SUM('Fact_Sales'[quantity])
MEASURE 'table'[Measure2] = SUM('Fact_Sales'[amount])
...
MEASURE 'table'[MeasureN] = SUM('Fact_Sales'[value])


Copy and Paste to DAX Query View window: copy the code from Excel and paste it into Power BI's DAX Query Window. Perform Unified Processing.

vjtianmsft_2-1738898423887.png

 


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.