DISTINCTCOUNTNOBLANK

Updated on

DISTINCTCOUNTNOBLANK is a DAX function that counts the number of distinct non-blank values in a specified column.

Syntax

DISTINCTCOUNTNOBLANK( ColumnName )
Argument Properties Description
ColumnName The column for which the distinct values are counted, no blank value included.

Return Values

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

Other functions related to DISTINCTCOUNTNOBLANK are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/distinctcountnoblank-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy