Forum Discussion

littlemojopuppy's avatar
littlemojopuppy
Community Champion
7 years ago
Solved

Calculate 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...
  • littlemojopuppy's avatar
    littlemojopuppy
    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])
            )
        )