Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Exact Age

Hello,

I'm trying to calculate the age of a personn at a date X. I have two columns, one is his birthday date and the other a date X . I would like to know the exact age of the personn at this day. For exemple if it's birthday is the 10/05/2018 and the X date is 11/05/2021, I would like to have 3. But if my X date is 09/05/2021 I would like to have 2.

I tried a datediff but after it gives me a number of day between those two dates and I don't know how to convert it to have the exact year cause of leap years...

if someone have a solution it would be very usefull.

Thank you

Have a nice day

Best regards

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Add the Age column as follows:

AGE = 
INT(
    DIVIDE(
        [DATE X]-[DOB],
        365.25
    )
)

Fowmy_0-1622451958723.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

Add the Age column as follows:

AGE = 
INT(
    DIVIDE(
        [DATE X]-[DOB],
        365.25
    )
)

Fowmy_0-1622451958723.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks!

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.