That sort of depends. Using surface shift in the dynamic filter; If you want only dirt to dirt set for max 3; If you want all dirt to dirt and turf to dirt set for max 6; If you want only turf to turf races set for min 12; If you want to eliminate only dirt to turf races clone the udm and set the first one to surface shift max 6 and the cloned udm to surface shift min 12.
Depending on your needs any variation on those factors etc. At least that's how I would approach it.