Set analysis is calculated once per chart, not once per row which is why it works fine when you have only one selected, but doesn't work when you have multiple patients in the chart.
What you need to do is something like:
=count(if([DischargeDate]>=date(AddYears(date(ServiceStartDate), -1) And [DischargeDate]<=date(ServiceStartDate, 'DD/MM/YYYY HH:MM:SS'), [DischargeDate]))
You might need to use aggr but off the top of my head I'm not sure. Also not sure how to change the text color...