cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pbiuserr
Post Prodigy
Post Prodigy

Calculate age in PowerQuery - null dates

Hello.

I would liek to calculate age in PowerQuery but some rows doesnt have the data in the column, therefore I'd like it to have age 0. Tried that (convert value) but it keeps giving me error. I am calculting age using ribbon in Transform data

1 ACCEPTED SOLUTION
Saap
Resolver III
Resolver III

Hi @Pbiuserr 

I assume that you have a column with birth dates. If yes, then you can create custom column like this:

Saap_0-1657268010333.png
Remember to change the birth date data type to datetime and after adding the age column change its type to whole/decimal number.

Saap_1-1657268081387.png

 

 

View solution in original post

2 REPLIES 2
Saap
Resolver III
Resolver III

Hi @Pbiuserr 

I assume that you have a column with birth dates. If yes, then you can create custom column like this:

Saap_0-1657268010333.png
Remember to change the birth date data type to datetime and after adding the age column change its type to whole/decimal number.

Saap_1-1657268081387.png

 

 

James-Harpin
Resolver IV
Resolver IV

Hi @Pbiuserr 

Would you be able to send an example of your data?

I would recommend creating a calculated column using an IF statment for Blank values to show 0

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors