This column formula seems to work ok for me
If(
:Label == "b" & Lag( :Label, 1 ) != "b",
(Lag( :Revenue, 2 ) + Lag( :Revenue, 1 )) / (Lag( :Room, 2 ) +
Lag( :Room, 1 )),
:Label == "b" & Lag( :Label, 1 ) == "b",
(Lag( :Revenue, 3 ) + Lag( :Revenue, 2 )) / (Lag( :Room, 3 ) +
Lag( :Room, 2 )),
0
)