Forum Discussion
fleuhusen
5 years agoRegular Visitor
DAX DateDiff Problem
Hello, This post is relating DateDiff, Dates and YearFrac. I'm not able to find a solution for this challenge. I've been looking at a LOT of other posts and a lot of them are talking about co...
- 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
TomMartens
Super User
5 years agoHey fleuhusen ,
try using this DAX statement:
DATEDIFF('tablename'[DOB], DATE(1900, 1, 1), YEAR)
Hopefully, this provides what you are looking for.
Regards,
Tom
fleuhusen
5 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)