Filtering by checkbox lookup table variable

Hi,
I am building an app for activities that can be supported by more than one donor at the same time (each with multiple grants), means: I can have a facility that supported by two donors, each with more than one grant.
I assigned a checkbox lookup tables for both donors and grants to enable me to select multiple donors with multiple grants at same time, I used selected(donor ID, value) to filter and select the grants (more than one) according to selected donors (more than one), but this does not work.

Please if someone advise me