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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sully343
Frequent Visitor

Multiple Questions..

Hello,

 

I'm building a "retirement predictor" for work. This is tied into an SQL database to pull a persons date of birth, and their hire date. I converted these dates to "Age" and "Years Service". The age/years service columns are just the basic conditional formatting in PBI. The "first name" column I'm trying to use DAX to create a value and then doing conditional formatting for the value (as recommended here by some). I'm just running into issue with it being ranges/the rules of it.

 

My measure is:

Condition = MAXX(ViewPersonnel,
IF(ViewPersonnel[Age] >= 50&& ViewPersonnel[originalsvcdate - Copy] >=25, 1,
IF(ViewPersonnel[Age] < 50&& ViewPersonnel[originalsvcdate - Copy] >=25,2
)))
 
Conditional formatting then looks at "condition" for 1, 2, 3, ect.
 
I'm trying to apply the following rules, but struggling because it seems to only pick up people under one of the rules and not account for the other...
 

If age >= 50 AND service >= 25, name is green.

If age < 50 and service >= 25 , name is orange

Age => 45 and service between 20-25, yellow

 

The second question is I'm also trying to have a slider (or something where you could input a date) that will allow this to "fast forward". IE the starting position would be "current date" and it would add 1-3 years to people's age/time (basically look into the future to see what it will look like in a year or so). If there's another way to accomplish this, that'd work as well. 

 

 

Screenshot 2022-09-22 151939.png

2 REPLIES 2
Anonymous
Not applicable

Hi @sully343 

Can you provide your sample data(remove sensitive info) us with excel or pbix file form ?

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

Here's a sample table. I can't figure out how to attach an excel file (it tells me xls not supported).

 

FirstLastRankAgeoriginalsvcdate - Copy
BrianSmithFR Captain42.524.78
MichaelTurnerFR Lieutenant51.225.01
GregMyersFR Tech4826.2
SeanWilliamsFR FF4420
RandyBuckFR FF4522

 

 

Based off this, I am trying to have the following criteria:

if age >= 50 AND service >= 25, name is green.

If age < 50 and service >= 25, name is orange

Age > 45 and service between 20-25, yellow

 

Based on that, Brian smith should not change color, Michael Turner should be green, greg myers should be orange, sean williams should not change, randy buck should be yellow.

 

Then I'm also trying to have a slider or a "date select" that will allow me look at days in the future (if a slider it would start at current year, then fast forward up to 5 years). Having a "select date" that defaults to the current date but could put dates in the future to make the ages/years of service increase (basically use it to look into the future by adding time to the 2 columns).

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.