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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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 )
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.