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
POSPOS
Helper IV
Helper IV

Calculated column to check eligibility

Hi all,

I have a requirement to check if a user is eligibile for a specfic service and the eligibility criteria is his age should be >=55 years and also have >=10 years of service.
I have to show the total users who are eligible as of today, within 3 years and within 5 years.
Sample data:

POSPOS_0-1709584194327.png


I was able to calculate the total users as of today using the below:
 

years of service = DATEDIFF(service date, TODAY(),YEAR)
Service Check = 
IF([years of service] >= 10 && [Age] >= 55,"Eligible","Not Eligible")


Can someone pls help with how we can show the get the count of users who are eligible within next 3years from today and next 5 years from today. Sample pbix file is available here.
 
Thank you.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@POSPOS 

you can try this

 

3 years = IF(DATEDIFF('Table'[service date], edate(TODAY(),36),YEAR)>= 10 && [Age]+3 >= 55,"Eligible","Not Eligible")
5 years = IF(DATEDIFF('Table'[service date], edate(TODAY(),60),YEAR)>= 10 && [Age]+5>= 55,"Eligible","Not Eligible")
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@POSPOS 

you can try this

 

3 years = IF(DATEDIFF('Table'[service date], edate(TODAY(),36),YEAR)>= 10 && [Age]+3 >= 55,"Eligible","Not Eligible")
5 years = IF(DATEDIFF('Table'[service date], edate(TODAY(),60),YEAR)>= 10 && [Age]+5>= 55,"Eligible","Not Eligible")
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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