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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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