Rollup dates from formula's


I’m trying to do a “max” date rollup, where it returns the last date. This works on a regular date field. However, I only want to track this for “in progress” projects so I’m using a SWITCH formula to return the dates from records in progress. Once I try to rollup the formula field the “max” values aggregation no longer works.

Any workarounds or ideas? Thanks!