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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jja
Helper III
Helper III

calculate sum between 2 tables

Hi

 

I have a table Components which conist of component name, weight

then i have table Transactions where it stores different transactions of components. I have relationship between tables 1-*

 

I want to sum in a visual table the total weight of transactions the user made. I can sum the Processed qty but fail to sum Processed weight. i see if component has weight of 2 kg and has 3 different transactions and if i just multiply weight and qty each record return me 6 kg and then the overall sum is incorect

The table looks looks somehting like this:

User|Processed qty|Processed weight

 

what i am doing wrong? pls help

 

 

2 ACCEPTED SOLUTIONS
calerof
Impactful Individual
Impactful Individual

Hi @jja ,

 

If you use this code you can calculate the total weight:

 

Total Weight = 
SUMX(
    Component_Transaction,
    [Quantity Total] * RELATED(Component[Weight])
)

 

With a transaction table like this:

Test1.png

 

This will be your result:

Test.png

Hope it helps.

Regards,

Fernando

View solution in original post

@jja , Hope I got the tables name right

 

Sumx(Transactions , [Processed qty]*  related(Component[Processed weight]))

View solution in original post

5 REPLIES 5
jja
Helper III
Helper III

thank you guys!!!!

calerof
Impactful Individual
Impactful Individual

Hi @jja ,

 

If you use this code you can calculate the total weight:

 

Total Weight = 
SUMX(
    Component_Transaction,
    [Quantity Total] * RELATED(Component[Weight])
)

 

With a transaction table like this:

Test1.png

 

This will be your result:

Test.png

Hope it helps.

Regards,

Fernando

amitchandak
Super User
Super User

@jja , Try measure like

Sumx(Transactions , [Processed qty]*[Processed weight])

Hi @amitchandak 

Processed weight is a measure that i want to achieve and weight column is stored in Components table
Transactions table has qty column and Processed qty measure

@jja , Hope I got the tables name right

 

Sumx(Transactions , [Processed qty]*  related(Component[Processed weight]))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.