Forum Discussion

Stuznet's avatar
Stuznet
Helper V
7 years ago
Solved

Multiple IF ISBLANK Condition

Hi, I’m struggling create an Aging Column and handle the blank. I created a calculated column Aging = VAR DaysBtwn = IF(ISBLANK([Date1]), BLANK(), IF(ISBLANK([Date2), BLANK(), ([DATE1] - [Date...
  • ChrisMendoza's avatar
    7 years ago

    Stuznet -

     

    AND ( ) only takes two arguements so you'd have to nest if you wanted to go that way.

     

    The following seems to work in my small sample that I created, possibly it will work for your data:

     

    Aging =
    VAR DaysBtwn =
        IF (
            ISBLANK ( Table1[DATE1] ),
            BLANK (),
            IF (
                ISBLANK ( Table1[DATE2] ),
                BLANK (),
                ( Table1[DATE1] - Table1[DATE2] ) * 1
            )
        )
    RETURN
        IF (
            ISBLANK ( DaysBtwn ),
            BLANK (),
            SWITCH (
                TRUE (),
                DaysBtwn < 31, "0-30 Days",
                DaysBtwn < 61, "30-60 Days",
                DaysBtwn >= 61, "61+ Days"
            )
        )