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
Samarth_18
5 years agoCommunity Champion
Hi cocoloco79
You can add another IF condition as shown below:-
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[ConsigneeName] ) = "ABC",<Your calculation if it is true> )
)We can provide you more specific Answer if you could share some sample data with expected output.
Thanks,
Samarth