The foreign exchange rate represents the value of one unit in the major currency in terms of a secondary currency.
When opening a trade, you execute the trade in a set amount of the major currency, and when closing the trade you do so in the same amount, the profit or loss generated by the round trip (open and close) trade will be in the secondary currency.
For example; if a trader sells 100,000 EURUSD at 1.2820 and then closes 100,000 EURUSD at 1.2760, his net position in EUR is zero (100,000-100,000) however his USD is not.
The USD position is calculated as follows 100,000*1.2820= $128,200 long and -100,000*1.2760= -$127,600 short.
The profit or loss is always in the second currency. For simplicity's sake, the P&L statements often show the P&L in USD terms. In this case, the profit on the trade is $600.