VALUES

Updated on

VALUES is a DAX function that returns a single-column table of unique values from a specified column or a table with the same columns as the input table containing unique combinations of values.

Syntax

VALUES( TableNameOrColumnName )
Argument Properties Description
TableNameOrColumnName A column name or a table name.

Return Values

When the input parameter is a column name, a single column table. When the input parameter is a table name, a table of the same columns is returned.

Remarks

  • When you use the VALUES function in a context that has been filtered, the unique values returned by VALUES are affected by the filter. For example, if you filter by Region, and return a list of the values for City, the list will include only those cities in the regions permitted by the filter. To return all of the cities, regardless of existing filters, you must use the ALL function to remove filters from the table. The second example demonstrates use of ALL with VALUES.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

  • For best practices when using VALUES, see Use SELECTEDVALUE instead of VALUES.

Example

The following formula counts the number of unique invoices (sales orders), and produces the following results when used in a report that includes the Product Category Names:

= COUNTROWS(VALUES('InternetSales_USD'[SalesOrderNumber]))

Returns

Row Labels Count Invoices
Accessories 18,208
Bikes 15,205
Clothing 7,461
Grand Total 27,659

Other functions related to VALUES are:

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

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