I used the Unpivoting node first to bring all the month columns in a single column then used 3 Lag Column nodes to compare each value in “Person”, “Activity” and “ColumnValues” (Amount) columns with the previous row. Used the first Rule Engine node to specify the “Start” row and then by using a Rank node, another Rule Engine Node and a Missing Value node I put the next corresponding rows in the same group. Finally in a Group Loop Start I have put the first the last row of each group in a single row and a few more nodes to create exactly the same table as you asked for.
wouldn’t your output table be the same if you had also number 2 for for Activity A under May, June or July -20? Maybe you want to add some additional information to table in order to distinguish those cases or it is not important…