Forum Discussion
TSI
7 years agoAdvocate I
Previous Month Value (return Text)
Hi Community, I have a table of employee IDs and their Pay Grades each month. I'm trying to create a new column 'Previous Month' which would show me the Pay Grade from the month before. ...
- 7 years ago
TSI try following measure
Prev Pay Grade = VAR __prevDate = CALCULATE( MAX( 'Table'[Calendar Date] ), FILTER( ALLEXCEPT( 'Table', 'Table'[Employee ID] ), 'Table'[Calendar Date] < MAX( 'Table'[Calendar Date] ) ) ) RETURN CALCULATE( MAX( 'Table'[Pay Grade] ), ALLEXCEPT( 'Table', 'Table'[Employee ID] ), 'Table'[Calendar Date] = __prevDate )
parry2k
7 years agoSuper User
TSI try following measure
Prev Pay Grade =
VAR __prevDate =
CALCULATE(
MAX( 'Table'[Calendar Date] ),
FILTER(
ALLEXCEPT( 'Table', 'Table'[Employee ID] ),
'Table'[Calendar Date] < MAX( 'Table'[Calendar Date] )
)
)
RETURN
CALCULATE( MAX( 'Table'[Pay Grade] ), ALLEXCEPT( 'Table', 'Table'[Employee ID] ), 'Table'[Calendar Date] = __prevDate )