Forum Discussion
cocoloco79
5 years agoHelper III
Parameter 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
amitchandak
5 years agoSuper User
cocoloco79 , Try a measure like
IF(
MAX(Invoiced[Qty Invoiced])<>MIN(Invoiced[Qty Sent]),
if( max(invoiced[ConsigneeName]) = "ABC" ,
SELECTEDVALUE('Market Price/ unit'[Parameter])*SUM(Invoiced[Not Invoiced Qty 1]),
SELECTEDVALUE('Market Price/ unit'[Parameter])*SUM(Invoiced[Not Invoiced Qty])
)
)