Forum Discussion
Mckenzie--Cl
3 years agoNew Member
Calculating age using 2 dates and then rounding down
I'm trying to calculate the age of people at the time they were diagnosed with a health condition. I have 2 dates, date of birth and date of diagnosis. I've managed to do this using DATEDIFF but so...
- 3 years ago
The reason DATEDIFF isn't working is because it counts the number of boundaries which have been crossed between the two dates, its not working to a particular number of days. A DATEDIFF between 31st Dec and 1st Jan gives 1 year, as 1 boundary has been crossed.
You could try instead using
Age = YEAR ( 'Table'[Date of diagnosis] - 'Table'[Date of birth] ) - 1900 - 3 years ago
pls try this
Ahmedx
Super User
3 years agopls try this
Mckenzie--Cl
3 years agoNew Member
That seems to have worked! Thanks very much Ahmedx.