Forum Discussion

cocoloco79's avatar
cocoloco79
Icon for Helper III rankHelper III
5 years ago
Solved

DAX to Show value when 0

Hello.

 

I'm reaching out becasue I'm stuck with a formula. I like to calculate the qty of corn cobs used for Prepack and Losse products.

Cobs Qty = (Query1[QtyInner]*Query1[QtyPieces])*Query1[Boxes] --- this formula calcualtes the prepacked qty correctly, however it retuns "0" when the product is "Loose". If OtyPieces is "0", I need the formula to look at QtyInner. Can someone help me with this? 

 

 

  • cocoloco79 , not very clear.

     

    A new column like

    Cobs Qty = if(Query1[QtyPieces] <>0 , (Query1[QtyInner]*Query1[QtyPieces])*Query1[Boxes],(Query1[QtyInner])*Query1[Boxes])

3 Replies

  • cocoloco79 , not very clear.

     

    A new column like

    Cobs Qty = if(Query1[QtyPieces] <>0 , (Query1[QtyInner]*Query1[QtyPieces])*Query1[Boxes],(Query1[QtyInner])*Query1[Boxes])

  • cocoloco79 

    Not clear, but try something like below.

    if(Query1[QtyPieces] =0 , Query1[QtyInner],Query1[QtyPieces])

     

    Regards, 

    Manikumar