Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
i am experimenting with DAX, VALUES() creates a table of unqiue values. if i use UniqueDates = Values(Sales[orderdate]) and drag this on a matrix or table i get the error, "a table of multiple values was suplied where a single value was expected".
i know I used a measure to create this, but i also assumed by 'dont summarize' it would be a Dimension and I could use it as a list of values.
it VALUES() creates a table or column of unique values why do I get an error? thanks for any help understanding
Solved! Go to Solution.
Measure will always return a scalar value, never a table, VALUES returns a table hence the error
you can use your syntax in a calculated table and it will have the behaviour you expect
EDIT - if you drag Sales[orderdate] to the visual it will only show unique values without any additional code
Measure should return single value in context, rather than scalar list.
In measure, VALUES can only be used as intermediate, to supply list to another function.
If you want to create list of unique from dates...
You could create new table in Modeling. And then use Table = VALUES(Table1[Date])
Though since Values will consider Blank as unique, I'd prefer to use DISTINCT (when there are null fields in the column).
Measure will always return a scalar value, never a table, VALUES returns a table hence the error
you can use your syntax in a calculated table and it will have the behaviour you expect
EDIT - if you drag Sales[orderdate] to the visual it will only show unique values without any additional code
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |