Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
98 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |