I invested 1000$ on 1st of Muharram of a year, on the 1st of Ramadan of the same year I got profit of 20$ from that 1000$, so what would be my calculation of jakah on the next year of 1st Muharram, on the basis of 1000$ or 1020$?
You need to sum up all the cash and properties intended for trade you have minus any outstanding debts. The sum of this is the basis for Zakaat. It does not matter if you have invested it or not. Once you have a nişaab, which is about 85 grams of gold or 595 grams of silver in value, then you wait for a year. If you still have the value of a nişaab, then you should pay 2.5% of what you have at that moment in Zakaat.