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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
cottrera
Post Prodigy
Post Prodigy

Today - Column Date = Age

Hi 

 

I have a table with a date issued column , however some of the fields are blank .  I would like to use a custom column function to do the following.

 

If date column - blank return blank else todays date - date issued / 365.24 = date in years (1 decimal point)

 

Example  of table and expected result

Issue DateAge in years
01/02/20220.3
02/02/20211.3
03/02/20202.3
  
09/02/20220.3
10/02/20220.3
11/02/20193.3
12/02/20211.3
13/02/20220.3
  
15/02/201012.3
15/02/20220.3
13/02/20184.3
14/02/20175.3
15/02/20139.3
16/02/201210.3

 

thank you

 

Richard

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

If you have already converted your column to date column, then blanks will be converted to null.

In this case, use below formula

= Number.Round(Duration.Days(Date.From(DateTime.FixedLocalNow())-[Issue Date])/365.24,1)

But looks like, you haven't converted the column to date, then you will have to use below formula

= Number.Round(Duration.Days(Date.From(DateTime.FixedLocalNow())-(if [Issue Date]="" then null else Date.From([Issue Date])))/365.24,1)

View solution in original post

2 REPLIES 2
cottrera
Post Prodigy
Post Prodigy

Perfect work fine thank you 😀

Vijay_A_Verma
Super User
Super User

If you have already converted your column to date column, then blanks will be converted to null.

In this case, use below formula

= Number.Round(Duration.Days(Date.From(DateTime.FixedLocalNow())-[Issue Date])/365.24,1)

But looks like, you haven't converted the column to date, then you will have to use below formula

= Number.Round(Duration.Days(Date.From(DateTime.FixedLocalNow())-(if [Issue Date]="" then null else Date.From([Issue Date])))/365.24,1)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.