Forum Discussion

webportal's avatar
webportal
Icon for Impactful Individual rankImpactful Individual
4 years ago
Solved

Why does COUNTROWS return EMPTY when it should return 0?

Why does this calculated column return an empty value, for rows that are equal to zero?

 

Number of Rows = 
VAR ThisIndex = 'Table'[Index]
RETURN
COUNTROWS(
    FILTER('OtherTable', 'OtherTable'[col] = ThisIndex)
) 

 

  • webportal , for no rows it will return blank, you can add +0 if needed

     

    Number of Rows = 
    VAR ThisIndex = 'Table'[Index]
    RETURN
    COUNTROWS(
        FILTER('OtherTable', 'OtherTable'[col] = ThisIndex)
    ) +0

     

1 Reply

  • webportal , for no rows it will return blank, you can add +0 if needed

     

    Number of Rows = 
    VAR ThisIndex = 'Table'[Index]
    RETURN
    COUNTROWS(
        FILTER('OtherTable', 'OtherTable'[col] = ThisIndex)
    ) +0