First, basis is basically the money that you have already paid taxes on that you invested in the partnership. At risk is the money that you are "at risk" to lose if the partnership goes belly-up. Basis and at-risk amounts are often the same and the terms are often used interchangably.
To get an idea of your basis, use the following formula:
Initial investment in the partnership
+ Gains from the partnership over all of the years that you have been a partner
- Losses claimed on your tax returns from the partnership over all of the years that you have been a partner
+ Any additional money you invested into the partnership over all the years that you have been a partner
- Any money you took out of the partnership over all the years that you have been a partner
= Basis (The computation is more complicated than this, but it will give you ballpark figure to work with.)
The basis needs to be computed every year and can never be negative. If you are computing basis for 2011, do not include any transactions that occurred in 2012. When you compute your 2012 basis, you will include all transactions for 2012 and all prior years, or just start with your 2011 basis and adjust for 2012 transactions.
You can only claim losses to the extent of your basis. If your basis is $10,000 and your loss is $20,000, you could only claim a loss up to $10,000. That would zero out your basis and you could not claim any more losses until your basis increases again.
Now, assuming that you have sufficient basis, you need to determine if the loss can be claimed under the passive activity rules. You can only deduct passive activity losses to the extent of passive activity income. Let's say you have a $10,000 loss that would be allowable under the basis (at-risk) rules. If the activity is passive, you would have to have passive income in order to claim any of the loss. If you only had $5,000 of passive income, then you could only claim $5,000 of the loss. The remaining $5,000 would be carried over until you did have passive activity income, at which time you could claim the passive losses up to the passive income you received that year.
If you had sufficient basis and passive income on the return, you very well may be entitled to a refund of some of the taxes you paid. However, it's not as easy as just showing a $20,000 loss on Schedule E. There is quite a bit of work that needs to be done before you do that, and you may not be entitled to deduct the entire $20,000...or any of it.