Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DISTINCTCOUNTNOBLANK

Hi,

I have following data -

 

 

 

 

 

 

 

 

And following measures -

CategoryCount = DISTINCTCOUNT(Category_Sales[Category])
CategoryCountNoBlank = DISTINCTCOUNTNOBLANK(Category_Sales[Category])
 
Result is as follows -
 
 
 
 
 
 
 
 
Why is DISTINCTCOUNTNOBLANK() not working correctly?
 
Regards
  • Anonymous -

     

    I do not know the reason why however, you could filter out the blanks by:

    Measure = 
    CALCULATE(
        DISTINCTCOUNT(Category_Sales[Category]),
        FILTER(
            Category_Sales,
            Category_Sales[Category] <> BLANK()
        )
    )

    returns 3.

1 Reply

  • ChrisMendoza's avatar
    ChrisMendoza
    Icon for Resident Rockstar rankResident Rockstar

    Anonymous -

     

    I do not know the reason why however, you could filter out the blanks by:

    Measure = 
    CALCULATE(
        DISTINCTCOUNT(Category_Sales[Category]),
        FILTER(
            Category_Sales,
            Category_Sales[Category] <> BLANK()
        )
    )

    returns 3.