This can be done with execute SQL or with a pair of relationships using duplicated table occurrences. The first option is only possible if you know SQL and are using FileMaker 12 or newer, but is the simpler way to go for this calculation.
The "multiple occurrence" method:
You already have this relationship presumably:
Donors::__pkDonorID = Donations::_fkDonorID.
Your names may be different but that would produce the results shown in your portal.
If you make some duplicates of the Donations occurrence (click button with two green plus signs), you can do this:
Donors::__pkDonorID = Donations|Year1::_fkDonorID AND
Donors::gYear1 = Donations|Year1::cYear
gYear1 would be a number field with global storage specified so that you can just enter the desired year once and have it work for all donors. cYear would be a calculation field with a number result type and this expression: Year ( DonationDate ).
You would repeat this for a third occurrence of donations, and a second global field:
Donors::__pkDonorID = Donations|Year2::_fkDonorID AND
Donors::gYear2 = Donations|Year1::cYear
Then this expression, defined in a calculation field in the donors table would return a 1 for every donor that made at least one donation in both specified years:
Not IsEmpty ( Donations|Year1::_fkDonorID ) and Not IsEmpty ( Donations::year2::_fkDonorID )
You'll be able to use this year after year by selecting different values in the two global year fields.
Thanks PMJ, this might be over my head but I will try it soon. Right now I just wanted to say thanks!