I would create two columns, Sequence with formula such as
As Constant(seq = 0);
If(Dif(:Data) != 1,
seq++
);
seq;
and then use that for calculations using Col Number
Col Number(:Sequence, :Sequence)
If you want to make first row missing, you can do that by adding if statement to result
If(Row() == Col Min(Row(), :Sequence),
.
,
Col Number(:Sequence, :Sequence)
)
-Jarmo