Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX: CALCULATE AND VALUES

Hi,  Let me make my question simple. I have a slicer where one can choose a date. And I have a date table with, amongst others, a month-end-flag (Y for the last date of the month) and a month-key...
  • Greg_Deckler's avatar
    Greg_Deckler
    3 years ago

    Anonymous Oh, sorry, the first one should have been:

    LastDate =
      var _monthkey = SELECTEDVALUE('Calendar'[Date])
      var _result = EOMONTH(_monthkey, 0)
    RETURN
      _result

    Also, the MAXX is just there to grab the value out of the table. You could also have used MINX. You might be able to use SELECTCOLUMNS instead of MINX or MAXX.