DAX Filter - DISTINCT function
Description
Returns a one column table that contains the distinct values from the specified column. In other words, duplicate values are removed and only unique values are returned.
You need to nest the DISTINCT function within a formula, to get a list of distinct values that can be passed to another function.
Syntax
DISTINCT (<column>)
Parameters
Sr.No. | Parameter & Description |
---|---|
1 |
column The column from which unique values are to be returned. Or, an expression that returns a column. |
Return Value
A column of unique values.
Remarks
The results of DISTINCT function are affected by the current filter context. For example, if you use the formula in the following example to create a calculated field, the results would change whenever the table was filtered on the column Region.
Example
= COUNTROWS (DISTINCT (Sales[Salesperson ID]))