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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
hi,
how can i use dax formula to create column Age with data type as decimal and the value is blank if the data in Birthday column is blank
then how to calculate average to exclude zero or null ?
| Name | Birthday | Age |
| A | 1/1/2022 | 1.17 |
| B | ||
| C | 1/12/2022 | 0.25 |
thanks
Solved! Go to Solution.
Hi @ktt777 ,
You can create a calculated column as below to get it:
Age = DIVIDE ( DATEDIFF ( 'Table'[Birthday], DATE ( 2023, 3, 19 ), MONTH ), 12 )
Best Regards
Hi @ktt777 ,
You can create a calculated column as below to get it:
Age = DIVIDE ( DATEDIFF ( 'Table'[Birthday], DATE ( 2023, 3, 19 ), MONTH ), 12 )
Best Regards
FYI that the Power Query editor has an Age function on the Add Column tab. That will create a duration column in days you can conver to Total Years. You can then use a measure like this to get the average.
Use a formula like this:
Your Column = DIVIDE( DATEDIFF ( BIRTHDAYCOLUMN, TODAY (), DAY ), 365 )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!