Forum Discussion
DAX DateDiff Problem
- 5 years ago
Hey fleuhusen ,
if you are creating a measure you have to wrap the reference to the DOB column into an aggregation function, something like this:
DATEDIFF(MIN('tablename'[DOB]), DATE(1900, 1, 1), YEAR)Of course, you have to choose the proper aggregation function 🙂 but this is the way how measures work.
Regards,
Tom
Hey fleuhusen ,
try using this DAX statement:
DATEDIFF('tablename'[DOB], DATE(1900, 1, 1), YEAR)
Hopefully, this provides what you are looking for.
Regards,
Tom
- TomMartens5 years agoSuper User
Hey fleuhusen ,
if you are creating a measure you have to wrap the reference to the DOB column into an aggregation function, something like this:
DATEDIFF(MIN('tablename'[DOB]), DATE(1900, 1, 1), YEAR)Of course, you have to choose the proper aggregation function 🙂 but this is the way how measures work.
Regards,
Tom
- fleuhusen5 years agoRegular Visitor
Thank you TomMartens . The challenge that comes up is that the DoB column doesn't come up as an option for the DateDiff formula. The DateDiff formula only is seeing other created measures, and no column names. The challenge is that the column has multiple values.
I used your formula:
Measure 3 dob test= DATEDIFF('TableName'[dob], DATE(1900,1,1),YEAR)