SELECT order_id, ordered_on,
COUNT(*) OVER () AS total,
COUNT(*) OVER (ORDER BY ordered_on) AS running,
COUNT(*) OVER (
ORDER BY ordered_on, order_id
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_rows
FROM orders
ORDER BY ordered_on, order_id;
OVER () has no ORDER BY, so every row sees the whole partition, here the whole table: 7 everywhere.
running climbs. But look at March 1 and March 3. Both orders on each date show the same count, 2 and then 5. So order 1's running count already includes order 2.
In the editor, write THROUGH_DAY: the running idea with SUM(amount), the revenue through the end of each order's date.