Forum Discussion

nh27's avatar
nh27
Helper III
2 years ago
Solved

COUNTBLANK & IF

I am trying to return a string that says "Not Blank" or "Blank" if all 3 columns I have in a table are ALL blank, but I'm hitting a bit of a roadblock trying to use an IF statement with COUNTBLANK. ...
  • AlexisOlson's avatar
    AlexisOlson
    2 years ago

    Hmm. That's what I wrote should do. (Note that it won't work as expected if any parentheses are removed.)

     

    You can do it in multiple steps if you prefer though:

    AvailableRowsWithBlankOrZero =
    VAR _AvailableRows_ =
        FILTER (
            'TableA',
            'TableA'[Column5] = "Available"
        )
    VAR _NonZeroRows_ =
        FILTER (
            _AvailableRows_,
            'TableA'[Column1] = 0 ||
            'TableA'[Column2] = 0 ||
            'TableA'[Column3] = 0
        )
    VAR _Count =
        COUNTROWS ( _NonZeroRows_ )
    RETURN
        _Count