Forum Discussion

Chetanab's avatar
Chetanab
Microsoft Employee
4 years ago
Solved

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))
IDIndexTeamNamePrevious Row(expected)
11  
12Team1 
13Team2Team1
14 Team2
15Team1 
16 Team1
17Team3 
18 Team3
19Team4 
110 Team4
111Team2 
112Team4Team2
113 Team4
114  
115  
116Team2 
117 Team2

1 Reply

  • smpa01's avatar
    smpa01
    Community Champion

    Chetanab 

     

    Column = MAXX(FILTER(t1,t1[Index]=EARLIER(t1[Index])-1),t1[TeamName])