Forum Discussion
Anonymous
2 years agoNot applicable
How to get previous value
I have a sample table as below: Display_Name Effective_Date Department Jason 2/1/2012 TCX Jason 7/1/2012 TCX Jason 7/1/2012 BFDA Jason 8/14/2012 BFDA Jason 8/21/2012 MB...
- 2 years ago
Hi Anonymous
Please try this measure:
Previous Department = CALCULATE ( MAX ( 'Table'[Department] ), OFFSET ( -1, ALLEXCEPT ( 'Table', 'Table'[Display_Name] ), ORDERBY ( 'Table'[Effective_Date], ASC ) ) )
rajendraongole1
2 years agoSuper User
Hi Anonymous - you can achieve this using calculated column dax
I have created index column from power query editor and used the function as below
PreviousDepartment =
VAR CurrentIndex = 'pvys'[Index]
VAR CurrentName = 'pvys'[Display_Name]
RETURN
CALCULATE(
MAX('pvys'[Department]),
FILTER(
'pvys',
'pvys'[Display_Name] = CurrentName &&
'pvys'[Index] = CurrentIndex - 1
)
)
in visual
Hope it helps
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
- Anonymous2 years agoNot applicable
Is it possible to use measure? Because the real data size is huge.