DISTINCT DAX Function (Table manipulation)

Returns a one column table that contains the distinct (unique) values in a column, for a column argument. Or multiple columns with distinct (unique) combination of values, for a table expression argument.

Syntax

DISTINCT ( <ColumnNameOrTableExpr> )
Parameter Attributes Description
ColumnNameOrTableExpr

The column (or table expression) from which unique values (or combination of values) are to be returned.

Return values

Table An entire table or a table with one or more columns.

A column of unique values if the parameter is a single column. If the parameter is a table expression, the result has the same columns and remove only duplicated rows.

Remarks

If the parameter is a single table, the result of DISTINCT is affected by the current filter context. In this case it is importa to understand the differences with VALUES, which might add an additional blank row in certain conditions.
If the parameter is a table expression, DISTINCT returns a table by removing duplicate rows provided by the table expression.

Related articles

Learn more about DISTINCT in the following articles:

Related functions

Other related functions are:

Last update: Oct 20, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/distinct-function-dax

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of DISTINCT? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.