Forum Discussion
Date aggregation lastdate vs max
- 9 years ago
Anonymous
Figured out the problem, it seems the measure should be MAX(table[date]) rather than MAX(table[date].[Date])
What a hassle!
Hi Nothing,
According to your screenshots, it seems like you use the calculate column. Max function and LAST DATE function has different result in measure and calculate column, you can take a look at below link to know more about them.
Reference link:
Calculated Columns and Measures in DAX
In addition, you can use var function to get the current value.
Formula:
MaxDate=
var currdate= Max([Date])
return
currdate
LastDate=
var currdate= LastDate([Date])
return
currdate
Regards,
Xiaoxin Sheng
Anonymous
Its a measure I'm using rather than calculated column
I'm using a matrix and trying to pivot on a group of columns with the max date as the value
The formulas you suggested gives the same results as just using lastdate/max on their own unforetunately
MaxDate=
var currdate= Max([Date])
return
currdate