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
5 years agoSuper User
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
TomMartens
5 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