Forum Discussion
Rajesh1
8 years agoHelper I
Dynamically calculating cost based on user input quantity
Good day, A sample of our product cost matrix per zone is as below: Zone Product Unit Cost Fixed service charges Quantity From Quantity To Variable Charges per unit USA P1 350 15 ...
- 8 years ago
Hi Rajesh1
Try this
You can pull the Applicable Variable Charge from "Cost Matrix" to your "Input Table" using this MEASURE
Applicable Variable Charge = CALCULATE ( VALUES ( CostMatrix[Variable Charges per unit] ), FILTER ( CostMatrix, CostMatrix[Product] = SELECTEDVALUE ( 'InputTable'[Product] ) && CostMatrix[Zone] = SELECTEDVALUE ( 'InputTable'[Zone] ) && SELECTEDVALUE ( 'InputTable'[Input Qty] ) >= CostMatrix[Quantity From] && SELECTEDVALUE ( 'InputTable'[Input Qty] ) <= CostMatrix[Quantity To] ) ) - 8 years ago
Thanks very much for your timely assistance, Zubair_Muhammad!
Works like a charm! thank you.. thank you.. thank you
Zubair_Muhammad
8 years agoCommunity Champion
Hi Rajesh1
Try this
You can pull the Applicable Variable Charge from "Cost Matrix" to your "Input Table" using this MEASURE
Applicable Variable Charge =
CALCULATE (
VALUES ( CostMatrix[Variable Charges per unit] ),
FILTER (
CostMatrix,
CostMatrix[Product] = SELECTEDVALUE ( 'InputTable'[Product] )
&& CostMatrix[Zone] = SELECTEDVALUE ( 'InputTable'[Zone] )
&& SELECTEDVALUE ( 'InputTable'[Input Qty] ) >= CostMatrix[Quantity From]
&& SELECTEDVALUE ( 'InputTable'[Input Qty] ) <= CostMatrix[Quantity To]
)
)- Rajesh18 years agoHelper I
Thanks very much for your timely assistance, Zubair_Muhammad!
Works like a charm! thank you.. thank you.. thank you