The error “Table calculation attribute reference(s) are missing in field wells” usually indicates that all fields used in calculations need to be present in the visualisation’s fields.
So, caseid and the fields involved in the condition isNull(successfuloutcomedate) need to be added to your visualisation.
To calculate the cumulative total with distinct_count, first, create a calculated field to handle the distinct count, something like: