Essentially, what you do is create a new list by filtering the table to only return the rows where the contact ID is the current rows contact ID
Then, you use find() to find its position in that new list. Heres a screenshot before you use find(), notice how what thisTable.filter(contactId = thisRow.contacId) creates a brand new list of rows