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

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.

Reply
Samiks95
Regular Visitor

Calculate age based on Date of Birth

Hello,

I have a column Date of Birth. And now, I want to calculate Age based on Date of Birth. I also want to do the age grouping.

2 ACCEPTED SOLUTIONS

@Luis98 Thank you Luis! 2-Table1-1.png

I want to create a age range based on the age. Similar to the attached pic.

View solution in original post

Ok, try with this, change "Table (4)"  with the name of the table where you have the column Age
 
Range = IF(AND('Table (4)'[Age]>=0,'Table (4)'[Age]<=16),"Child",IF(AND('Table (4)'[Age]>=17,'Table (4)'[Age]<=30),"Young Adults",IF(AND('Table (4)'[Age]>=31,'Table (4)'[Age]<=45),"Middle-aged Adults","Old-aged Adults")))

View solution in original post

4 REPLIES 4
Luis98
Resolver II
Resolver II

Hi @Samiks95,

 

You can create this column:

Age = DATEDIFF([Date of Birth],TODAY(),YEAR)
 
And i dont understand about the age grouping what do you want to do.

@Luis98 Thank you Luis! 2-Table1-1.png

I want to create a age range based on the age. Similar to the attached pic.

Ok, try with this, change "Table (4)"  with the name of the table where you have the column Age
 
Range = IF(AND('Table (4)'[Age]>=0,'Table (4)'[Age]<=16),"Child",IF(AND('Table (4)'[Age]>=17,'Table (4)'[Age]<=30),"Young Adults",IF(AND('Table (4)'[Age]>=31,'Table (4)'[Age]<=45),"Middle-aged Adults","Old-aged Adults")))

@Luis98 Thank you so much. It worked.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors