Related record counter

Related record counter

I have table 1 "sources" and table 2 "applications". Each record in table 2 has a mandatory lookup field to table 1.

I want a counter that says: record 1.A from table 1 appears in x records in table 2, in the lookup field. I'd like this counter in different reports.

Furthermore, I'd like to filter that by other values in table 2. "Count related records with the value Z in this other field".

How can this be done? Sorry if I've missed something obvious in the docs. Thanks!