Difficult to answer on the basis of a verbal description of the problem. In the attached file, example of solving as a variant. Tables "Table1" and "Table2" create the the data, as I understand them from your description. Table "TableFilterCountry" is created specially for use in the filter.
If the example does not help, you could not submit a sample of their source data?
Temp_filter.qvf 174.5 K