Forum Discussion
what values is doing in Calculate
Hi Team,
I came across following dax.
CALCULATE (
[Sales Amount],
DATESYTD ( 'Date'[Date] ),
VALUES ( 'Date'[Day of Week] )
just wanted to understand what VALUES is exactly doing in above DAX.
Thanks in adv
It looks like the author is expecting, or at least allowing for, a slicer or filter to be placed on the days of the week. VALUES will return only those days which are selected, so those days will be added to the filter context.
The reason that they needed to add that, rather than just allowing the filter to take effect, is that when you have a table marked as a date table and you then apply a filter to the date column, all other filters on the date table are automatically removed, at least that is my understanding.
1 Reply
- johnt75
Super User
It looks like the author is expecting, or at least allowing for, a slicer or filter to be placed on the days of the week. VALUES will return only those days which are selected, so those days will be added to the filter context.
The reason that they needed to add that, rather than just allowing the filter to take effect, is that when you have a table marked as a date table and you then apply a filter to the date column, all other filters on the date table are automatically removed, at least that is my understanding.