Forum Discussion
pisca
2 years agoFrequent Visitor
How To Calculate Total Matrix Using Average
Hi, I have a problem when I want to calculate the total weight from the multiplication of quantity and weight. When I try to use several functions calculated, sum, summarize and average. The res...
- 2 years ago
So, I create a measure quantity like this
quantity = SUMX( SUMMARIZE( 'table', 'table'[product_name], 'table'[inv_number] ), CALCULATE( AVERAGE( 'table'[quantity] ) ) )and then, I made one more measure weight like this
weight = SUMX( SUMMARIZE( 'table', 'table'[product_name], 'table'[inv_number] ), CALCULATE( AVERAGE( 'table'[product_weight] ) ) )last, I made one more measure total weight like this
totalweight = SUMX( SUMMARIZE( 'table', 'table'[product_name], 'table'[inv_number] ), [quantity] * [weight] )the results were as I expected.
Thanks tamerj1
pisca
2 years agoFrequent Visitor
So, I create a measure quantity like this
quantity =
SUMX(
SUMMARIZE(
'table',
'table'[product_name],
'table'[inv_number]
),
CALCULATE(
AVERAGE(
'table'[quantity]
)
)
)and then, I made one more measure weight like this
weight =
SUMX(
SUMMARIZE(
'table',
'table'[product_name],
'table'[inv_number]
),
CALCULATE(
AVERAGE(
'table'[product_weight]
)
)
)last, I made one more measure total weight like this
totalweight =
SUMX(
SUMMARIZE(
'table',
'table'[product_name],
'table'[inv_number]
),
[quantity] * [weight]
)the results were as I expected.
Thanks tamerj1