Forum Discussion
What's the difference between Firstdate/Lastdate(Date.Date) and Max/Min(Date.Date)?
- 8 years ago
Hi SteveD2,
Firstdate() returns a table with only one value so can't find a value less than the value itself. So Date[Date] < Firstdate(Date[Date]) will return blank.Please refer to this blog: http://sqlblog.com/blogs/marco_russo/archive/2013/10/22/difference-between-lastdate-and-max-for-semi-additive-measures-in-dax.aspx.
In addtion, you can use
result = Calculate( MAX('Date'[Date]), LASTDATE('Date'[Date]))instead of
result = Calculate( MAX('Date'[Date]), FILTER('Date', 'Date'[Date] = MAX('Date'[Date])))Regards,
Jimmy Tao
Hi SteveD2,
Firstdate() returns a table with only one value so can't find a value less than the value itself. So Date[Date] < Firstdate(Date[Date]) will return blank.Please refer to this blog: http://sqlblog.com/blogs/marco_russo/archive/2013/10/22/difference-between-lastdate-and-max-for-semi-additive-measures-in-dax.aspx.
In addtion, you can use
result = Calculate( MAX('Date'[Date]),
LASTDATE('Date'[Date]))
instead of
result = Calculate( MAX('Date'[Date]),
FILTER('Date', 'Date'[Date] = MAX('Date'[Date])))
Regards,
Jimmy Tao