Forum Discussion

cocoloco79's avatar
cocoloco79
Helper III
5 years ago
Solved

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!  ...
  • Samarth_18's avatar
    Samarth_18
    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