Forum Discussion
Almantas32
6 years agoHelper II
Sumx issues
Hey Guys,
I have a problem with simple measure using sumx function. I am trying to calculate the total weight of manufactured goods, by multiplying the quantity (produt.qty) with the weigth (weight) in related table, line by line.
I am using this formula:
Total Weight = SUMX('public mrp_production', SUM('public mrp_production'[product_qty]) * RELATED('public product_template'[weight]))
The results line by line are correct, but the total is too small. What am I doing wrong?
I am attaching the link to the desktop file:
https://drive.google.com/file/d/1y1HjVbeMGENMTAtYeE6wKRBjeLyHAWZl/view?usp=sharing
https://drive.google.com/file/d/1y1HjVbeMGENMTAtYeE6wKRBjeLyHAWZl/view?usp=sharing
Any help much appreciated.
Almantas32 , Try like
SUMX('public mrp_production', 'public mrp_production'[product_qty] * RELATED('public product_template'[weight]))
2 Replies
- amitchandakSuper User
Almantas32 , Try like
SUMX('public mrp_production', 'public mrp_production'[product_qty] * RELATED('public product_template'[weight]))
- Pragati11Super User
Hi Almantas32 ,
Try modifying your DAX as follows:
Total Weight = SUMX('public mrp_production',
SUM('public mrp_production'[product_qty]) * RELATED(SUM('public product_template'[weight])))Thanks,
Pragati