DISTINCTCOUNTNOBLANK
Applies to: Calculated column Calculated table Measure Visual calculation
Counts the number of distinct values in a column.
Syntax
DISTINCTCOUNTNOBLANK(<column>)
Parameters
Term | Description |
---|---|
column |
The column that contains the values to be counted |
Return value
The number of distinct values in column
.
Remarks
Unlike DISTINCTCOUNT function, DISTINCTCOUNTNOBLANK does not count the BLANK value.
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
Example
The following example shows how to count the number of distinct sales orders in the column ResellerSales_USD[SalesOrderNumber].
= DISTINCTCOUNT(ResellerSales_USD[SalesOrderNumber])
DAX query
EVALUATE
ROW(
"DistinctCountNoBlank", DISTINCTCOUNTNOBLANK(DimProduct[EndDate]),
"DistinctCount", DISTINCTCOUNT(DimProduct[EndDate])
)
[DistinctCountNoBlank] | [DistinctCount] |
---|---|
2 | 3 |