update:
try:
=IFERROR(ARRAYFORMULA(QUERY({
QUERY({INDIRECT("Data!A2:D"), WEEKNUM(INDIRECT("Data!A2:A"))},
"select Col5,sum(Col2),sum(Col3),sum(Col4),count(Col5)
where Col1 is not null group by Col5", ), IFERROR(
QUERY({INDIRECT("Data!A2:D"), WEEKNUM(INDIRECT("Data!A2:A"))},
"select Col5,sum(Col2),sum(Col3),sum(Col4),count(Col5)
where Col1 is not null and Col1 < date '"&TEXT(TODAY(), "e-m-d")&"' group by Col5")*SEQUENCE(ROWS(
QUERY({INDIRECT("Data!A2:D"), WEEKNUM(INDIRECT("Data!A2:A"))},
"select sum(Col2) where Col1 is not null group by Col5", )), 1, 1, 0))}, "offset 1", )), "e")