DAX VALUES function
Returns the distinct values of a column (or the rows of a table) visible in the current filters.
VALUES gives the list of values that are "in view": in a table row for France it returns just France. It is how you iterate over groups and read what a slicer selected.
Syntax
VALUES(<table or column>)| Argument | Required | Description |
|---|---|---|
| table or column | Required | The column whose distinct visible values you want, or a table. |
Returns: A one-column table of distinct values (or the table's rows).
Examples
Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).
1. Countries in view, by segment
Countries in View = COUNTROWS(VALUES(financials[Country]))| Segment | Countries in View |
|---|---|
| Channel Partners | 5 |
| Enterprise | 5 |
| Government | 5 |
| Midmarket | 5 |
| Small Business | 5 |
| Total | 5 |
Every segment sells in all five countries.
Good to know
- VALUES can include a blank row when a relationship has unmatched values; DISTINCT doesn't.
- To get one selected value as a scalar, use SELECTEDVALUE.
Related functions
Official reference: VALUES function on Microsoft Learn