Forum Discussion
Chetanab
4 years agoMicrosoft Employee
Get previous row
I have the below table with 3 columns ID, Index and TeamName. I am trying to create a new column for previous row. I tried below DAX but its only giving me partial result. Please help.
Previous row del =
calculate(MAX(Table1[TeamName]),FILTER(Table1,Table1[ID]=EARLIER(Table1[ID])&&Table1[Index]=EARLIER(Table1[Index])-1))
| ID | Index | TeamName | Previous Row(expected) |
| 1 | 1 | ||
| 1 | 2 | Team1 | |
| 1 | 3 | Team2 | Team1 |
| 1 | 4 | Team2 | |
| 1 | 5 | Team1 | |
| 1 | 6 | Team1 | |
| 1 | 7 | Team3 | |
| 1 | 8 | Team3 | |
| 1 | 9 | Team4 | |
| 1 | 10 | Team4 | |
| 1 | 11 | Team2 | |
| 1 | 12 | Team4 | Team2 |
| 1 | 13 | Team4 | |
| 1 | 14 | ||
| 1 | 15 | ||
| 1 | 16 | Team2 | |
| 1 | 17 | Team2 |
1 Reply
- smpa01Community Champion