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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Is it possible to create a measure suitable for multiple pivot tables?

Hi all,

 

I need to integrate two pivot tables, PA and PB. PA comes from datasource DA, PB comes from datasource DB and both PA and PB have a measure ROI.

 

In order to show the ROI fields, I have created two measures under DA and DB, but the calculation logic is the same. Say ROI in PA is:

 

=DIVIDE(AVERAGE(DA[actual_income]),SUM(DA[cost]))

then ROI in PB is

=DIVIDE(AVERAGE(DB[actual_income]),SUM(DB[cost]))

This seems to be duplicated work. So is it possible to create just one measure(or something else), and can be applied to multiple pivot tables? Just like something below:

=DIVIDE(AVERAGE(actual_income]),SUM([cost]))

 

You help would be greatly appreciated!

1 ACCEPTED SOLUTION

Hi @Anonymous

 

You can keen DatasourceA and DatasourceB in-tact, but maybe create a DatasourceC which is additional and is just the first two tables Appended/Unioned together.

 

In the Query Editor you can use the Append as new feature but you'll need to make sure the columns are aligned.  

 

Append.png

 

In Power BI you can create a new calculated table using the following code, but you will need to make sure two tables share the same column structure.

 

Table = UNION(TableA,TableB)

 

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

How similar are the two data sources?  Can the tables be combined into 1 (using DAX or M) which may reduce the number of measures you need to make?

 

Even if you leave the two datasources in tact for other reasons, you could perhaps create a third datasource which is the two stacked together?  Just a question/suggestion really


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

Hi @Phil_Seamark,

 

Thanks for you reply.

Unfortunately, for some reasons, those two data sources must be kept intact even though some of their fields are quite similar.

I could definitely try combine those two datasource as one. Do you know if there is a quick way to combine those two?

 

 

 

Hi @Anonymous

 

You can keen DatasourceA and DatasourceB in-tact, but maybe create a DatasourceC which is additional and is just the first two tables Appended/Unioned together.

 

In the Query Editor you can use the Append as new feature but you'll need to make sure the columns are aligned.  

 

Append.png

 

In Power BI you can create a new calculated table using the following code, but you will need to make sure two tables share the same column structure.

 

Table = UNION(TableA,TableB)

 

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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