Forum Discussion

ConnorAlign's avatar
ConnorAlign
Copper Contributor
May 21, 2024

FILTER and COUNTA function returning 1 even when no data is found

Hi, I am using the formula below to track an unique count of Red Hat Enterprise OS which are in a specific migration wave. However, the formula is returning a count of "1" even though there are no...
  • djclements's avatar
    May 21, 2024

    ConnorAlign Try using the ROWS function wrapped in IFERROR:

     

    =IFERROR(ROWS(UNIQUE(FILTER(MasterServerToApp[Server], (MasterServerToApp[Wave] = B4) * ISNUMBER(SEARCH("Red Hat Enterprise", MasterServerToApp[OS Trim]))))), 0)

     

    Or process the results of the include parameter first to make sure at least 1 record returns TRUE:

     

    =LET(
        incl, (MasterServerToApp[Wave] = B4) * ISNUMBER(SEARCH("Red Hat Enterprise", MasterServerToApp[OS Trim])),
        IF(OR(incl), ROWS(UNIQUE(FILTER(MasterServerToApp[Server], incl))), 0)
    )

     

Resources