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,
As CheenuSing said, if you share some detailed information about your issue, it will be help for troubleshooting.(e.g. sample data, screenshots, detailed info about columns or measures)
Regards,
Xiaoxin Sheng
Anonymous
Hi Xiaoxing,
What I'm trying to recreate is the "Maximum" option thats available when displaying numbers as a value in a matrix but with the latest date.
I've created a measure with both LASTDATE and MAX functions, both return the last date of the whole column (31/12/2050) rather than the contextual value that the numeric aggregation gives as you can see below, the dates should be different
Thanks,
Nicola
- Anonymous9 years agoNot applicable
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])
returncurrdate
LastDate=
var currdate= LastDate([Date])
returncurrdate
Regards,
Xiaoxin Sheng
- Nothing9 years agoFrequent Visitor
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])
returncurrdate
- Anonymous9 years agoNot applicable