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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Multiply 2 columns from 2 different data tables

Help me!

 

I have 2 data tables link with look_up table throug Field PID:

  1. Table 1 [PID, Balance] link with Look_up table[PID]: relation n*1
  2. Table 2 [PID, RATE] link with Look_up table [PID]: relation n*1

How to calculate field RATE * BALANCE?

 

I try use SUMX & RELATE, but it not work, becaus 2 data table Tabale 1 and Table 2 not Link directly (relationship type n * n).

 

Many thanks

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

=sumx(relatedtable(table1),sumx(relatedtable(table2),table1[Balance]*table2[rate]))

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

I tested on my side. Here's my data model.

vstephenmsft_0-1638781480119.png

 

You need to put the [PID] from Look_up table into the visual.

Measure = SUM('Table 1'[Balance])*SUM('Table 2'[RATE])

vstephenmsft_2-1638781606861.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Wow, It looks more simple. I like your solution.

I will test. Actually Table 1 and Table 2 link with 2 lookup: PID & Currency like that:

Table1 (PID, Currency, Balance)

Table2 (PID, Currency, Rate)

I will try to use your solution to check whether it works. Thank you very much

wdx223_Daniel
Community Champion
Community Champion

=sumx(relatedtable(table1),sumx(relatedtable(table2),table1[Balance]*table2[rate]))

Anonymous
Not applicable

Awesome, it works.

But could you help me to understand more about the logic here.

Function SUMX: SUMX(Table, Expression)

  • Table: Table in which the expression will be evaluated
  • Expression: Expression to be evaluated for each row of the given table

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.