Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

US Payroll per Period Comparision

Background: We process payroll two times a month: on the 15th of the month and the last day of the month. You may ignore issues around weekend/holidays for this problem.   Problem: I am trying to...
  • VahidDM's avatar
    VahidDM
    4 years ago

    Hi Anonymous 

     

    Try this measure:

    WagePreviousPeriod = 
    VAR _Lat_Period =
        CALCULATE (
            MAX ( PayRegister[Payroll Date] ),
            FILTER (
                ALL ( PayRegister ),
                PayRegister[Payroll Date] < MAX ( PayRegister[Payroll Date] )
            )
        )
    RETURN
        CALCULATE (
            [WageCurrentPeriod],
            FILTER ( ALLEXCEPT(  PayRegister,PayRegister[EMP ID]), PayRegister[Payroll Date] = _Lat_Period )
        )

     

    Output:

     

     

     

     

    Download the attached file.

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/