Fix grouping of threshold date