Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 there any other way to calculate age which support direct query mode ?
Solved! Go to Solution.
thanks for replay but actually I do this in simple way :
Age = ROUNDDOWN(((1,0*(TODAY()-Partner[DateOfBirth]))/365);0)
thanks for replay but actually I do this in simple way :
Age = ROUNDDOWN(((1,0*(TODAY()-Partner[DateOfBirth]))/365);0)
Hi @dawcza3,
Nice solution!
Could you accept your reply as solution to help others who may have similar issue easily find the answer and close this thread?
Regards
Noob question, my apologies. I have a very similar need and don't understand where I would define "Age" so that it can be included in the visualization. Is this a new column, or a measure?
Secondly, could it be applied to a summarized result. Using this example, to find the age of the youngest person in a family?
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.
Age = YEAR ( TODAY () ) - YEAR ( Table1[DateOfBirth] ) + IF ( DATE ( 1900, MONTH ( TODAY () ), DAY ( TODAY () ) ) < DATE ( 1900, MONTH ( Table1[DateOfBirth] ), DAY ( Table1[DateOfBirth] ) ), - 1, 0 )
Regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
87 | |
61 |