Calculating percentage change on row level

Hello knimers,

I am trying to create a loop that sort the date and the name of a variable then calculates the percentage change between rows

it should not compute the change when the variable name is different

I would really appreciate help