cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## How to write a Dax measure using the date table with mutable IF conditions

Dear All,

I need help in writing a Dax measure using the date table with mutable IF conditions as below:

I need two measures  :

1- (total days btween the date that I'll select in the silcer and the employee Hire Date  + the Extra days / 365 ) now we will have the years of employment for each in a measure or a coulmn, now in other measure or the same one if the years >=18 I need to return 100% if it's >=15 return 75% if >=12 return 50% if >=9 return 25% other return 0

if the employee hire date is 01-01-2010 and the slicer date is 01-01-2023 he will have 13 years then he will be 50%, if the slicer date is 01-01-2027 he will have 17 Years then he will be 75%

2- the other measure is the easy one if we complete the above, it will take the years of employment * the Salary * the above mesure % 100% or 75% or 50% or 25%.

please find the below data to be used:

 Name Hire Date Salary Extra Days Name 1 6/1/2000 0:00 3000 0 Name 2 6/1/2000 0:00 2500 0 Name 3 6/1/2000 0:00 4000 0 Name 4 12/13/2010 0:00 2500 1065 Name 5 4/24/2011 0:00 2500 0 Name 6 4/28/2011 0:00 1500 0 Name 7 5/1/2011 0:00 4000 0 Name 8 5/24/2011 0:00 3500 1840 Name 9 6/7/2011 0:00 700 0 Name 10 7/3/2011 0:00 800 0 Name 11 7/10/2011 0:00 1200 0 Name 12 8/1/2011 0:00 500 1640 Name 13 9/11/2011 0:00 950 0 Name 14 10/4/2011 0:00 1800 0 Name 15 5/4/2014 0:00 1400 0 Name 16 6/10/2014 0:00 1660 0 Name 17 5/8/2016 0:00 5890 0 Name 18 5/22/2016 0:00 650 0 Name 19 5/23/2016 0:00 850 0 Name 20 6/1/2016 0:00 954 0 Name 21 6/12/2016 0:00 3650 0 Name 22 7/12/2016 0:00 800 0 Name 23 7/17/2016 0:00 900 0
2 REPLIES 2
Super User

Hi,

Please find attached my PBI solution file.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

see attached

Announcements

#### 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.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors