passive loss rules

My K1 has a loss in Box 1 but a gain in Box 2.  I have filled out a worksheet for each activity.  Can I reduce the amount of the loss in Box 1 by the gain in Box 2 before calculating how much of the loss I can deduct this year.