A DAX function that returns how many different values appear in a column, with BLANK counted as a value. Totals of distinct counts can't simply be added up across categories.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains DISTINCTCOUNT in context, with comparison tables and the common traps.
Terms in this definition
- DAX
Short for Data Analysis Expressions, the formula language you write measures, calculated columns and row-level security rules in, within tabular semantic models in Power BI, Excel Power Pivot or Analysis Services.
- FUNCTION
Registered models count as functions in Unity Catalog, so this securable type governs them too: access is given through
GRANT ... ON FUNCTION, and REST calls passFUNCTIONassecurable_type. - RETURNS
States what a function gives back, as a type or a table, inside
CREATE FUNCTION. SQL functions can leave it out and have the type worked out from their body. - VALUES
Returns in DAX the distinct column values, or table rows, still visible after filters are applied, sometimes with an extra blank entry. CALCULATE often takes the result as a table filter.
- BLANK
DAX uses BLANK to mean no value at all. It resembles NULL in SQL but behaves more like an empty cell in Excel, so adding 20 to it returns 20; the BLANK function creates one and ISBLANK detects it.
- DISTINCT
Removes duplicates so that each row appears once; it can be used in a
SELECT, an aggregate or a set operation.
Related terms
- DISTINCTCOUNTNOBLANK
A DAX function returning how many different values a column contains while leaving BLANK out of the count, which DISTINCTCOUNT does not do.