0
votes

How to eliminate "BLANK" when the criteria does not meet? I'm trying to get count of rows with value greater than 0 else return nothing or 0 using DAX measure. I have negative values also in my column so just trying to count only above 0. Any suggestions? With below I can achieve count but if there are no rows meeting the criteria it returns "BLANK"

Measure=CALCULATE(COUNT('TableX'[column]),FILTER('TableX','TableX'[column]>0))

1

1 Answers

1
votes

Try adding a zero:

Measure =
CALCULATE (
    COUNT ( 'TableX'[column] ),
    FILTER ( 'TableX', 'TableX'[column] > 0 )
) + 0

You can also wrap the measure with the FORMAT function to output as text, which turns a blank into an empty string "".

Measure =
FORMAT (
    CALCULATE (
        COUNT ( 'TableX'[column] ),
        FILTER ( 'TableX', 'TableX'[column] > 0 )
    ),
    "0"
)

Use whatever custom format you'd prefer to display the result as.