Forum Discussion
Anonymous
6 years agoNot applicable
Help calculating age on a specific date
Hello all, I have a column with DOB and need to find the person's age on June 1, 2019. I figured it out but I wanted to see if anyone had a more concise way of coding it. = Table.AddColumn(#...
Christophe
Helper II
6 years agoThe simplest way I can think of:
1. Select your DOB column
2. Select Add Column > Date > Age. Power Query will build for you the following formula:
= Table.AddColumn(#"Replaced Value1", "Age", each Date.From(DateTime.LocalNow()) - [DOB], type duration)
3. Replace DateTime.LocalNow() with your fixed date:
= Table.AddColumn(#"Replaced Value1", "Age", each Date.From("6/1/2019") - [DOB], type duration)