Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Measure to Count Distinct Values But Ignore 0

I have a chart that shows distint values but sometimes the value is 0. I want to exclude 0 from the count. How can I go about doing this?

  • Hard to help without an example, have you considered creating your own column to count?

    Something such as if(value > 0, 1, 0) aggregate this column to get your total

  • Not stated whether the filter is to be applied to the same value column but try this:

    CALCULATE ( DISTINCTCOUNT ( data[value] ), KEEPFILTERS ( data[value] <> 0 ) )
    

2 Replies

  • ajohnso2's avatar
    ajohnso2
    Solution Supplier

    Hard to help without an example, have you considered creating your own column to count?

    Something such as if(value > 0, 1, 0) aggregate this column to get your total

  • Not stated whether the filter is to be applied to the same value column but try this:

    CALCULATE ( DISTINCTCOUNT ( data[value] ), KEEPFILTERS ( data[value] <> 0 ) )