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 II
Resolver II

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 II
Resolver II

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
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors