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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
bourne2000
Helper V
Helper V

Error in calculating Age column?

Hi

 

I am having Birthdate and calculated age in Power query using Durations. Most of the ages are correct. However, some of the year the age is coming wrong. Please see the snapshot.

 

bourne2000_0-1622788754512.png

 If you see the screenshot, the year 1951 appears multiple times, and the age calculated wrongly. This shows age 140, 210, some of the records it calculated correctly.

 

Could you please advise what went wrong?

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@bourne2000 

I am not sure what calculation you used to get the age, anyhow, you can add the following code as a new custom column to calculate the correct age in years:

=Number.RoundDown(
  Number.From( (Date.From(DateTime.LocalNow()) - [BirthDate] ) /365.25),
  0
)

 

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

1 REPLY 1
Fowmy
Super User
Super User

@bourne2000 

I am not sure what calculation you used to get the age, anyhow, you can add the following code as a new custom column to calculate the correct age in years:

=Number.RoundDown(
  Number.From( (Date.From(DateTime.LocalNow()) - [BirthDate] ) /365.25),
  0
)

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.