Ниже для BigQuery Standard SQL
#standardSQL
SELECT *,
COUNT(1) OVER(PARTITION BY customer_id ORDER BY order_date) count_cumulative_product_id
FROM `project.dataset.table`
Вы можете протестировать, поиграть с выше, используя примеры данных из вашего вопроса, как в примере ниже
#standardSQL
WITH `project.dataset.table` AS (
SELECT '2020-01-01' order_date, 123456 customer_id, '0001' product_id UNION ALL
SELECT '2020-01-02', 123456, '0005' UNION ALL
SELECT '2020-01-03', 123456, '0010'
)
SELECT *,
COUNT(1) OVER(PARTITION BY customer_id ORDER BY order_date) count_cumulative_product_id
FROM `project.dataset.table`
-- ORDER BY order_date
с результатом
Row order_date customer_id product_id count_cumulative_product_id
1 2020-01-01 123456 0001 1
2 2020-01-02 123456 0005 2
3 2020-01-03 123456 0010 3