Forum Discussion
SUMPRODUCT
Hi all!
I need help to set a new measure. I have 3 tables: Product, Product Sales and Product Ingridients. I need to creat a measure that calculates de amount of ingredients I consumed. The tables are related by Product.
Example:
The correct answer here is 733 * 5 + 719 * 5, no (733+719)*(5+5).
Thanks!
- Anonymous3 years ago
Hi Marcos_Noguer ,
Here I create a sample to have a test.
SumProduct = VAR _SUMMARIZE = SUMMARIZE ( VALUES ( 'Table 1'[ID] ), [ID], "Value", CALCULATE ( SUM ( 'Table 1'[Value] ) ) * CALCULATE ( SUM ( 'Table 2'[Value] ) ) ) RETURN SUMX ( _SUMMARIZE, [Value] )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hi Marcos_Noguer ,
Here I create a sample to have a test.
SumProduct = VAR _SUMMARIZE = SUMMARIZE ( VALUES ( 'Table 1'[ID] ), [ID], "Value", CALCULATE ( SUM ( 'Table 1'[Value] ) ) * CALCULATE ( SUM ( 'Table 2'[Value] ) ) ) RETURN SUMX ( _SUMMARIZE, [Value] )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Marcos_NoguerNew Member
Hi RicoZhou,
Thank you! It works perfectly! Kudus to you!