Forum Discussion
dawcza3
9 years agoFrequent Visitor
Calculate Age with Direct Query Support
I'm trying to calculate Age from DateOfBirth. Actually I'm do this with transformation date to age and round down. It's works ok, but it not avalaible to use data in direct query mode. So, is ther...
- 9 years ago
thanks for replay but actually I do this in simple way :
Age = ROUNDDOWN(((1,0*(TODAY()-Partner[DateOfBirth]))/365);0)
v-ljerr-msft
9 years agoMicrosoft Employee
Hi dawcza3,
According to your description above, you should be able to use the formula below to create a calculate column to calculate age in direct query mode.:smileyhappy:
Age =
YEAR ( TODAY () ) - YEAR ( Table1[DateOfBirth] )
+ IF (
DATE ( 1900, MONTH ( TODAY () ), DAY ( TODAY () ) )
< DATE ( 1900, MONTH ( Table1[DateOfBirth] ), DAY ( Table1[DateOfBirth] ) ),
- 1,
0
)Regards