If they work alone, did you try putting them in a case statement:
First parameter; desired result if true;
Second parameter; desired result if true;
Third parameter //default if first 2 aren't true
) // end case
Your case statement will probably be much more complicated than that, considering the many combinations you could have. I cant really tell by your post how the parameters are separated.
Keep in mind if there are a lot of portal records, this may be very slow
You may want to try this at the relationship level.