Forum Discussion

Ramachandran's avatar
Ramachandran
Icon for Helper III rankHelper III
4 years ago

Dynamically to load hire date?

Hi,
My source data it contains two columns one Employeename and another one Hiredate.
how will you populate the next hiredate and the interval time for 6 months upto 10 yrs?
I would expect the output format

source data

 

Is it possible to show dynamically future hiredate? if it possible, please provide suggestion for this.
regards,

Ram

4 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional

    What is the logic for creating Last working day of 6th month?

    Let's take 2 examples - 1-Apr-22 and 4-Mar-22 for which last working day of 6th month have been given as 1-Jul-22 and 31-Aug-22. 

     

    • Ramachandran's avatar
      Ramachandran
      Icon for Helper III rankHelper III

      The condition should not morethan 180 days.

      Condition:
      If 180th days = Saturday then 180days-1
      else if 180th days = Sunday then 180days-2 else 180th days.

      Always the day should not week ends/holiday.

      • Vijay_A_Verma's avatar
        Vijay_A_Verma
        Icon for Most Valuable Professional rankMost Valuable Professional

        Use below formula

        Next Hire Date1 = 
        VAR _HireDate = 'Table'[Hire Date]+180
        RETURN
        _HireDate-((
            WEEKDAY(_HireDate,2)>5)+
            (WEEKDAY(_HireDate,2)>6
        ))

        For next 180 days, just change the reference [Hire Date] to [Next Hire Date1]

        Next Hire Date2 = 
        VAR _HireDate = 'Table'[Next Hire Date1]+180
        RETURN
        _HireDate-((
            WEEKDAY(_HireDate,2)>5)+
            (WEEKDAY(_HireDate,2)>6
        ))

        For next, [Next Hire Date1] will be changed to [Next Hire Date1] and so on

  • Ramachandran 

     

    You can make use of Measures like,

     

    Add 6_months = EOMONTH( DATE(YEAR(HIRE[Hire Date]),MONTH(HIRE[Hire Date])+6,DAY(HIRE[Hire Date])),0)
     
    This will give you the EOM of the 6th month but I don't get the explanation here, please explain more in detail...