Reply
Regular Visitor
Posts: 43
Registered: ‎04-14-2017
Accepted Solution

Calculating age from a date and time

[ Edited ]

I'd be extreemly grateful if someone could help with this. I have a column containing date and time information. From this I need to create a new column which shows the age based on the date (in days).

 

 

I also have a seperate dataset with a start date and end date (date and time) which I need to calculate the days between the start and end.

 


Accepted Solutions
Highlighted
Super Contributor
Posts: 1,341
Registered: ‎05-10-2016

Re: Calculating age from a date and time

@johnbradbury

 

Use "New Column" not "New Measure"

View solution in original post


All Replies
Super Contributor
Posts: 1,341
Registered: ‎05-10-2016

Re: Calculating age from a date and time

@johnbradbury

 

hi,

 

To calculate the age in Days:

 

Age = DATEDIFF(Table1[DateTimeColumn],TODAY(),DAY)

 

to calculate the days between the start and end.

  

DaysBetween = DATEDIFF(Table1[StarDate],Table1[EndDate],DAY)

Regular Visitor
Posts: 43
Registered: ‎04-14-2017

Re: Calculating age from a date and time

Thanks you...

 

I seem to have done something wrong (assuming it's me as a newbie):

 

21-04-2017 09-02-41.png

Super Contributor
Posts: 1,299
Registered: ‎11-25-2016

Re: Calculating age from a date and time

My best guess is that you need to choose "New Column" first.

Highlighted
Super Contributor
Posts: 1,341
Registered: ‎05-10-2016

Re: Calculating age from a date and time

@johnbradbury

 

Use "New Column" not "New Measure"

Regular Visitor
Posts: 43
Registered: ‎04-14-2017

Re: Calculating age from a date and time

Thank you for taking the time to help me, it's much appreciated.