Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Chetanab
Microsoft Employee
Microsoft 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))
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 ACCEPTED SOLUTION
smpa01
Super User
Super User

@Chetanab 

 

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

 

smpa01_0-1637261529509.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

1 REPLY 1
smpa01
Super User
Super User

@Chetanab 

 

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

 

smpa01_0-1637261529509.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.