Forum Discussion
cocoloco79
Helper III
5 years agoParameter with condition
Hi everyone I need to add a second parameter which will kick in if (invoiced[ConsigneeName]) is "ABC" to apply a diffrenet price. Can someone assist with this? Much appreciated!!! thank you! ...
- 5 years ago
Hi cocoloco79
Based on your all inputs. Below code would required to get desired output:-
Estimated_market_price = VAR result = IF ( MAX ( Invoiced[Qty Invoiced] ) <> MAX ( Invoiced[Qty Sent] ), IF ( MAX ( Invoiced[Consignee] ) = "Kalfresh", SUM ( Invoiced[Estimated market price] ), SUM ( Invoiced[$/Unit] ) ) ) RETURN IF ( result = 0, 0, result )Output:-
Please let me know if it works for you.
Thanks,
Samarth
cocoloco79
Helper III
5 years agoHi Samarth_18 and amitchandak
I have used the measure below, but If use the Estimated Market Price Kalfresh' parameter then the calculation doesn't kick in.
However if I use the 'Market Price/ unit' the calculation works, but also includes Kalfresh.
Here is the Measure:
Estimated market price =
IF(
MAX(Invoiced[Qty Invoiced])<>MIN(Invoiced[Qty Sent]),
SELECTEDVALUE('Market Price/ unit'[Parameter])*SUM(Invoiced[Not Invoiced Qty]),IF(MAX(Invoiced[Market])="Kalfresh" ,SELECTEDVALUE('Estimated Market Price Kalfresh'[Estimated Market Price Kalfresh])*SUM(Invoiced[Not Invoiced Qty])
))
I have uploaded some sample data here sample data
Your help is much appreciated. Thank you!
Samarth_18
Community Champion
5 years agoHi cocoloco79 ,
Sample data link is not working for me. Could you please paste some sample data here if it is not sensitive and also what is the output you are getting with expected output data. Measure code looks fine to me I can check if you could provide above required details.
Thanks,
Samarth