Hi @SK20 and welcome to the Quick Community!
In regards to your calculated field error; when using the lag function, you cannot use a dynamic value/row to base your calculation off of; it provides the variance based on a lookup index, which has to be a set number. So you would need to create some type of ranking first, that way you can utilize the lookup index to refer to another row.