PostgresSQL - cumulative sum grouped by values Have this query returning right values where c.tiporifiuto = 0
WITH data AS (
    SELECT TIME_BUCKET_GAPFILL('1 day', c.dataora) as giorno
         , SUM(c.peso) as totale
    FROM conferimenti_001_1d AS c
    WHERE c.idcomune = 3 
      AND c.dataora &gt;= '2020-06-01' 
      AND c.dataora &lt;= '2020-06-12' 
      AND c.tiporifiuto = 0
    GROUP BY giorno
    ORDER BY giorno ASC
) SELECT giorno, SUM(totale) OVER (ORDER BY giorno ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) 
  FROM data 

returning
       giorno        |   sum   
---------------------+---------
2020-06-01 00:00:00 |   24.09
2020-06-02 00:00:00 |   48.05
2020-06-03 00:00:00 |   88.96
2020-06-04 00:00:00 |  183.78

Need same query but grouping ALSO for tiporifiuto, expected results should be
       giorno        |   sum   |  tiporifiuto
---------------------+------------------------
2020-06-01 00:00:00 |   24.09  |  0
2020-06-01 00:00:00 |   36.09  |  2
2020-06-01 00:00:00 |   13.09  |  3
2020-06-02 00:00:00 |   48.05  |  0
2020-06-02 00:00:00 |   72.18  |  2
2020-06-02 00:00:00 |   26.18  |  3
2020-06-03 00:00:00 |   xx.05  |  0
2020-06-03 00:00:00 |   xx.96  |  2
2020-06-03 00:00:00 |   xx.78  |  3

help pls
UPDATE
Source data is a materialized view
CREATE MATERIALIZED VIEW public.conferimenti_001_1d
TABLESPACE pg_default
AS
   SELECT time_bucket('1 day'::interval, c.dataora) AS dataora,
   sum(c.peso) AS peso,
   c.tiporifiuto,
   c.idcomune
   FROM conferimenti c
   GROUP BY (time_bucket('1 day'::interval, c.dataora)), c.idcomune, 
   c.tiporifiuto
WITH DATA;

SOLVED WITH
WITH data AS (
    SELECT TIME_BUCKET_GAPFILL('1 day', c.dataora) as giorno, SUM(c.peso) as totale, c.tiporifiuto
    FROM conferimenti_001_1d AS c
    WHERE c.idcomune = 3 AND c.dataora &gt;= '2020-06-01' AND c.dataora &lt;= '2020-06-12'
    GROUP BY giorno, c.tiporifiuto
    ORDER BY giorno ASC, c.tiporifiuto ASC
) 
SELECT giorno, SUM(totale) OVER (PARTITION BY tiporifiuto ORDER BY giorno ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as totale, tiporifiuto 
FROM data
WITH data AS (
    SELECT TIME_BUCKET_GAPFILL('1 day', c.dataora) as giorno, SUM(c.peso) as totale, c.tiporifiuto
    FROM conferimenti_001_1d AS c
    WHERE c.idcomune = 3 AND c.dataora &gt;= '2020-06-01' AND c.dataora &lt;= '2020-06-12'
    GROUP BY giorno, c.tiporifiuto
    ORDER BY giorno ASC, c.tiporifiuto ASC
) 
SELECT giorno, SUM(totale) OVER (PARTITION BY tiporifiuto ORDER BY giorno ASC 
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as totale, tiporifiuto 
FROM data