COVID-19: Choose between our familiar (but now socially distanced) classroom training courses and our excellent new live online courses.
A simple way to move a measure from one table to another
You can't drag and drop measures between tables, but there is an easy way to move them in Power BI Desktop, as this blog shows

Posted by Andy Brown on 08 June 2017

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

How to move measures between tables (or group them)

This won't change anyone's life, but it contains two nice little tips not many people know about. 

The problem

The problem: you have two measures in your Purchase table, but want to show them together.

 

Method 1 - move the measures to a different table

Suppose you've created a measure in one table, and want to move it to another:

Moving a measure

You've created a measure called Average sales in the Purchase table, but want to move it to the All measures table.

 

To do this, first select the measure you want to move:

Select measure to move

The measure we want to move.

 

Now choose a different home table for it on the Measure tools tab of the ribbon:

Moving a measure

Just choose which table you want the measure to belong to.

Power BI Desktop automatically redraws your field list:

New measure home

The measure appears automatically in its new home.

  

Simple - but strangely satisfying!  Be warned, however, that any other measures which reference this one in DAX formulae will need updating manually 

One caveat: .  You could probably use the MDSCHEMA_MEASURES table in the DAX Studio editing tool to do this programmatically, but even if you succeeded I can't see how you'd save your changes back to your Power BI report.

You can avoid this problem by using unique names for your measures, and not qualifying them with a table name.  For example, consider these two (slightly pointless) measures.  First one using table names:

Average sales = DIVIDE(

// divide total sales by the number of purchases

Purchase[Total sales],

'All measures'[Number of purchases]

)

Now the same measure, but not using table names:

Average sales = DIVIDE(

// divide total sales by the number of purchases

[Total sales],

[Number of purchases]

)

Providing that the two measures called Total sales and Number of purchases have unique names in your data model (that is, you don't have two measures in different tables with the same names), you'll be able to move the second measure to any table you like without affecting any existing formulae.

Method 2 - put your measures in a folder

To avoid having to move your measures, just put them in folders.  To do this, first go to Model view:

Model view

Go to Model view.

 

Select your measure, and type in a folder path for it:

Folder path for measure

Here I've gone for a folder and subfolder, but you don't have to have the second level if you don't want.

Repeating this could give you a structure like this:

Organised measures

Your measures are now tidied away into folders.

 

Thanks to Julian Edwards of Ageas Insurance for this idea, as well as the one below.  If you want to learn more about writing measures in DAX, consider booking onto our online DAX course or classroom DAX course.

This blog has 1 thread Add post
20 Nov 19 at 18:02

More often than not Wise Owl has the answers to most ignored questions on the internet especially in SQL Server or Power BI.  Thanks!

20 Nov 19 at 18:31

A pleasure!

15 May 20 at 13:42

Andy, I am on the March 2020 version of PBI, I can now move the measures using a ribbon called 'measure tools' to another home measure table, but if i have other measures in the original location referencing the moved measure then the DAX formulas do not seem to rename dynamically.  Am I missing something? for example I am moving measures for actuals and budget, but the variance measure that uses these two measures does not change to their new location.   any advice would be appreciated thanks.

Andy B  
24 May 20 at 10:25

I tried using DAX Studio - you can find measures referrring to the ones you've just moved, but i don't think there's any way to change them.  I've added a hint to the original blog to explain that you'll have to repair broken formulae manually.

Andy B  
15 May 20 at 15:19

Don't think you're missing anything.  I think you can probably use DAX Studio to do a global find and replace in all your measures, and if I get the time will blog on this next week (and let you know, and post the link here).