Forum Discussion
Anonymous
9 years agoNot applicable
Calculating age from a date and time
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...
- 9 years ago
Anonymous
Use "New Column" not "New Measure"
Vvelarde
Community Champion
9 years agoAnonymous
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)
Anonymous
6 years agoNot applicable
I used the Query Editor to "Insert a Custom Column" (Add Column tab). I inserted the formula given here, but PowerBI doesn't seem to like the DATEDIFF function. The system inserted the Table.AddColumn bit up to the DATEDIFF.
= Table.AddColumn(#"Removed Columns", "ItemAge", each DATEDIFF([FirstDetected],TODAY(),DAY))Advice welcome.