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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Danny-Happy
Helper I
Helper I

Age based on selected date

Hi All,

 

I want to see the age of our employees on a chosen date in a filter(so not today).
I got a table with employee name an DOB and a calender table.
Which measure should I use?

 

Many thanks!

1 ACCEPTED SOLUTION

thx, you have to remove the relationship between Date and DOB. Otherwise Date filters Employee and shows only the people that had a birthday ON THE SELECTED DATE.

View solution in original post

5 REPLIES 5
lukiz84
Memorable Member
Memorable Member

please show your model and some sample data

thx, you have to remove the relationship between Date and DOB. Otherwise Date filters Employee and shows only the people that had a birthday ON THE SELECTED DATE.

Danny-Happy
Helper I
Helper I

When i use the measure i don't get a response, see image

DannyHappy_0-1712577593997.png

 

lukiz84
Memorable Member
Memorable Member

Age =
VAR SelectedDate = SELECTEDVALUE(DateTable[Date])
VAR SelectedDOB = SELECTEDVALUE(Employees[DOB])

RETURN DATEDIFF(SelectedDOB, SelectedDate, YEAR)

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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