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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Morganius
Frequent Visitor

Calculate the Number of people that will be retired

Hi, 

 

I have the following problem and I can not find my way out... 

 

I have a table with the Employees information, some basic info like below:

Morganius_1-1687442608886.png

Now, based on the following 2 slicers, I would like to know whether this employee will be retired or not.

Slicer 1: Number of Year (0 to 10) --> This is the number of years in the future.

Slicer 2: Retirement Age (60 to 70) --> Age when you will get retired.

 

My final goal is to be able to show per Company how many people will be retired considering the selection done in the 2 previous slicers. Any thoughs?

 

I was trying with a measure like below but I got stucked while considering all the Ages and companies...

Is_Retired? =
VAR NUM_YEAR = SELECTEDVALUE(years[Number of Years])
VAR Ret_Age = SELECTEDVALUE('Ret Age'[Retirement Age])
VAR Math = IF((Min('Employe'[Age ]) + NUM_YEAR - Ret_Age)>=0,"YES","NO")
return Math
 
Thanks.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Morganius ,

 

You could try this meausre:

Number of retirees per company = 
var _reage=SELECTEDVALUE('Slicer 2'[Retirement Age])
var _year=SELECTEDVALUE('Slicer 1'[Number of Year])
return CALCULATE(COUNT('Table'[Name]),FILTER(ALLSELECTED('Table'),[Company]=MAX('Table'[Company])&&[Age]+_year>=_reage))

vstephenmsft_0-1687748668977.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Morganius ,

 

You could try this meausre:

Number of retirees per company = 
var _reage=SELECTEDVALUE('Slicer 2'[Retirement Age])
var _year=SELECTEDVALUE('Slicer 1'[Number of Year])
return CALCULATE(COUNT('Table'[Name]),FILTER(ALLSELECTED('Table'),[Company]=MAX('Table'[Company])&&[Age]+_year>=_reage))

vstephenmsft_0-1687748668977.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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