You can try this: df['IncrValue'] = df.groupby(['Var1', 'Var2', 'Var3', 'Var4'])['CumValue'].diff().fillna(0)
print(df)