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
I am having Birthdate and calculated age in Power query using Durations. Most of the ages are correct. However, some of the year the age is coming wrong. Please see the snapshot.
If you see the screenshot, the year 1951 appears multiple times, and the age calculated wrongly. This shows age 140, 210, some of the records it calculated correctly.
Could you please advise what went wrong?
Solved! Go to Solution.
@bourne2000
I am not sure what calculation you used to get the age, anyhow, you can add the following code as a new custom column to calculate the correct age in years:
=Number.RoundDown(
Number.From( (Date.From(DateTime.LocalNow()) - [BirthDate] ) /365.25),
0
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@bourne2000
I am not sure what calculation you used to get the age, anyhow, you can add the following code as a new custom column to calculate the correct age in years:
=Number.RoundDown(
Number.From( (Date.From(DateTime.LocalNow()) - [BirthDate] ) /365.25),
0
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |