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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
allawr
Employee
Employee

Copying measures across tables

I have a collection of about 15 tables (in SQL database FWIW), each has the same ~~15 metrics, but different dimensions. I import the tables into PowerBI (15 queries, straightforward).

 

Then, on one table, I define 15 measures, which tell PowerBI how to properly aggregate the metrics (weighted average - SUMX(<tablename>,[count]*[<metric>])/SUM([count]), for each <metric>).

 

Now, I want to copy those same measures and put them on each of the other tables. (1) Seems I have to enter all 15 measure formulae again by hand (well I can copy/paste individually but that's about it). (2) I have to use different names for the measures on each table.

 

Is there something I'm missing here? Can I have a measure that's parameterized by / a function of which table to apply it to, or something like that? Maintaining 15 copies is going to be a real headache. Otherwise I am having to merge all the tables together to make one super-table in PowerBI, which probably works but is quite messy...

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @allawr,

Agree with ankitpatira. An idea about copying measures in Power BI has been submitted in the following link, please vote it.

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13219620-duplicate-measure-and-fo...

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
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

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

Hi @allawr,

Agree with ankitpatira. An idea about copying measures in Power BI has been submitted in the following link, please vote it.

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13219620-duplicate-measure-and-fo...

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

https://www.microsoft.com/store/apps/9N60JMZCMCHC

 

You could keep measures as excel list and inside that copy past with unique names per tables then insert to all tables with the tool

 

Best

ankitpatira
Community Champion
Community Champion

@allawr Unfortunately not i don't think you will be able to get measures created across all the tables automatically. Since via query editor you can't create measures or don't get access to them (only via Modelling tab) you can't parameterise them or create a function for them. So manually creating them is your only option  I think.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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