Group by after merging

Is it possible to “group by” after merging two groups? I would like to group by date two different data. Each has a date field with which I would like to group everything.

Thanks in advance