Forum Discussion

jderekc's avatar
jderekc
Helper IV
8 years ago
Solved

DAX - Variant Data Type error IF statement

Hi all,   I am writing a DAX formula to return a text result ("NED", which means "not enough data") if a quantity on hand of an item is less than a certain amount.  However, if it is true, then it ...
  • TomMartens's avatar
    TomMartens
    8 years ago

    Hey,

     

    try this 

     

    IF(
      AND(
        InvAnalytics[Calc4_qOH] >= 2 
        ,NOT ISBLANK(InvAnalytics[Calc4_qOH])
      )
      ,FORMAT(InvAnalytics[Calc4_qOH], "#.##")
      , "NED"
    ) 

     

    this could be an alternative

     

    IF(
      AND(
        InvAnalytics[Calc4_qOH] >= 2 
        ,InvAnalytics[Calc4_qOH] <> ""
      )
      ,FORMAT(InvAnalytics[Calc4_qOH], "#.##")
      , "NED"
    )

     

    BLANK() returns a BLANK() meaning NULL value whereas ISBLANK(...) checks if a column reference is empty

     

    Regards

    Tom