Forum Discussion

fleuhusen's avatar
fleuhusen
Regular Visitor
5 years ago
Solved

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...
  • TomMartens's avatar
    TomMartens
    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