Hi Merry You might want to try this ClearCollect( lStudent_col, With( { Items: SortByColumns( AddColumns( Filter( // Filter to include only records with "State" = "Inactive" Students As S, LookUp(Students, Email_Link = S.Email_Link).State = "Inactive" ), "AcummulatedPoints", Sum( Filter(Class_Activities, FK_Attending_Student.Surname = S.Surname), Points ) ), "AcummulatedPoints", SortOrder.Descending ) }, ForAll( Sequence(CountRows(Items)), Patch( Last(FirstN(Items, Value)), {RowNumber: Value} ) ) ) ); This filters the Students table to include only those students whose State is Inactive and proceeds with the rest of the operations (calculating accumulated points, sorting, and adding row numbers) Please lmk if it works.