Forum Discussion
littlemojopuppy
Community Champion
7 years agoCalculate Measure With Two Parameters for Every Row in Table
Hi...I might be overthinking this but I've gone around in circles for hours with this. I'd appreciate any help anyone is willing to give. I'm trying to calculate the economic order quantity for a b...
- 7 years ago
So the solution I was trying was very resource intensive. After thinking about it, there was no need for the filter or ALLSELECTED...the row context took care of the filtering. While the other code works, it's not efficient. This worked MUCH better...
EOQ = SQRT( SUMX( 'Stock Weekly', (2 * 'Stock Weekly'[12MonthUsage] * 'Ordering Cost'[Ordering Cost Value]) / (('Holding Cost'[Holding Cost Value]/100) * 'Stock Weekly'[Unit Price]) ) )
littlemojopuppy
Community Champion
7 years agoHi Yuliana -
it worked! Winner winner chicken dinner!
Thank you again for your help!!!
-David
littlemojopuppy
Community Champion
7 years agoSo the solution I was trying was very resource intensive. After thinking about it, there was no need for the filter or ALLSELECTED...the row context took care of the filtering. While the other code works, it's not efficient. This worked MUCH better...
EOQ =
SQRT(
SUMX(
'Stock Weekly',
(2 * 'Stock Weekly'[12MonthUsage] * 'Ordering Cost'[Ordering Cost Value]) / (('Holding Cost'[Holding Cost Value]/100) * 'Stock Weekly'[Unit Price])
)
)