Forum Discussion
Syndicate_Admin
Administrator
4 years agoCalculate Percentage Last Increase
Hello! I have the following information in the dataset. My datasets are distinguished from month to month by the "last day of the month" column. Employee ID Last day of the month Last Increa...
tamerj1
Community Champion
4 years agoHi Syndicate_Admin
Here is a sample file with the solution https://www.dropbox.com/t/VxePA5I71I36fxiz
Last % increase =
VAR CurrentDate = Payroll[Last day of the month]
VAR CurrentSalary = Payroll[Monthly Total]
VAR CurrentEmployeeTable = CALCULATETABLE ( Payroll, ALLEXCEPT ( Payroll, Payroll[Employee ID] ) )
VAR DatesBeforeTable = FILTER ( CurrentEmployeeTable, Payroll[Last day of the month] < CurrentDate )
VAR PreviousDate = MAXX ( DatesBeforeTable, Payroll[Last day of the month] )
VAR PreviousSalay = MAXX ( FILTER ( DatesBeforeTable, Payroll[Last day of the month] = PreviousDate ), Payroll[Monthly Total] )
RETURN
DIVIDE ( CurrentSalary - PreviousSalay, PreviousSalay, 0 )