You can fill up the table with the missing rows using the function generate_series (), so a window function would return correct data. You can select the period of report specifying start and end dates in generate_series ():