I've made a change to the SQL example by using COUNT(DISTINCT DATE). It should now only count unique dates for each PRN. Example here.
If you're willing to create an Advanced Query, it would be the most straightforward solution since you can just convert that SQL example into the OutSystems syntax. It would look a bit like this:
SELECT {DB1}.[PRN], Year({DB1}.[Date]), MONTHNAME({DB1}.[Date]), COUNT(DISTINCT {DB1}.[Date])
FROM {DB1}
GROUP BY {DB1}.[PRN], Year({DB1}.[Date]), MONTHNAME({DB1}.[Date])
However, you would have to create it in server-side logic if you're building a mobile app. With COUNT(DISTINCT DATE) I believe this can no longer be done in an Aggregate.