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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.