Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

The MAX function in DAX only accepts a column reference as an argument

Hi All, I am new to DAX. Below is my code: var maxdate = MAX((DATEADD(DimDate[Date], -1 , month))) From research, DATEADD returns A table containing a single column of date values.   However, I...
  • jdbuchanan71's avatar
    6 years ago

    Hello Anonymous 

    Instead of MAX try it with LASTDATE, should give you what you are looking for.

    VAR maxdate = LASTDATE ( DATEADD ( DimDate[Date],-1, MONTH ) )