Forum Discussion
melhajj
6 years agoHelper I
How to Calculate Age dynamically
Greetings Community, I have a table that contains Employee Number, Hire Date, Date of Birth and Age. The "Age" column reflects the age as of today i.e. Current Date - Date of Birth I have add...
- Anonymous6 years ago
Hi melhajj ,
Refer this measure.
Measure = var a = YEAR(TODAY())-YEAR(SELECTEDVALUE('Table'[Date of Birth])) return IF(ISFILTERED(slicer[year]),a-(YEAR(TODAY())-SELECTEDVALUE(slicer[year])),a)Result would be shown as below.
Best Regards,
Jay
melhajj
6 years agoHelper I
amitchandak az38 thank you for your guidance and replies. I am actually trying to do something a bit more complicated. As per the image i attached , I am trying to group the employees in age groups accorsding to the year i am selecting. So in the image, the chart represents how many people where in the company at a certain year. in this image , i am using the "Age" fieled i had already mentioned (which is wrong because AGE is the age as of today) , I do know now that i have to use a measure to calculate the age depending on the year selected but how can i do the age grouping ? Appreciate any guidance.