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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.