Forum Discussion

NILU090's avatar
NILU090
Icon for Helper II rankHelper II
4 years ago
Solved

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. ...
  • johnt75's avatar
    4 years ago

    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.