Here is a script that creates your sample data table, and applies the formula to the Desired Counter: column
New Table( "Example",
Add Rows( 6 ),
New Column( "Month",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 1, 2, 2, 3, 3] )
),
New Column( "Day",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 1, 2, 3, 1, 1] )
),
New Column( "Desired Counter:",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If( Row() == 1,
x = 1,
If( Lag( :Month ) != :Month | Lag( :Day ) != :Day,
x = x + 1
)
);
x;
)
)
)
It produces this data table:
Jim