Can I carryforward, and carry back, K1 losses?

For 2015, a lounge business lost money.

In 2016, it made money. So I paid taxes on it, but the gains were not offset by the 2015 losses.

Can I offset the 2016 gains by the 2015 losses?

If so, I will have to amend my return.

Also, for 2017, the K1 will show a LOSS.

So can I apply that 2017 loss to offset the 2016 gain?

Basically, can 2015 and 2017 be applied to offset 2016?

Or can only 2015 (or perhaps it can't be applied).

Finally, what's the easiest way to go in and amend the return to reflect this?

Thanks!