The pnl calculation is done in 2 steps. By definition, you value your portfolio as of today, you value your portfolio as of yesterday, and the difference will be your pnl.
Now that's an important number (that gets reported, etc.) but that doesn't give you a lot of information on what generated that pnl.
The second step is to move every variable that could affect your pnl to measure the contribution that a change in this variable has on the total pnl.
For a Zero coupon bond for instance, which has a TV of $\exp(-r(T-t)/365)$ (very generic, you need to account for repo etc.). You will report the pnl as follows:
PnL(1-0)=$(\exp(-r_0((T-t-1)/365)) - \exp(-r_0((T-t)/365))) + (\exp(-r_1((T-t)/365)) - \exp(-r_0((T-t)/365))) + \varepsilon$.
The first them is your carry, your $\theta$, ie the money you make because your bond is pulled to par (if there was a coupon it would be included in this). The second term is due to your change in interest rate. $\varepsilon$ is simply what you can't explain. If everything is neat, your $\varepsilon$ should not be too high. You can also see that this is very close to a Taylor expansion when everything is linear, which is why you can use your duration as an approximation for the 2nd term.
On the equity side, if you sold an option for instance, it is the same process but with more variables (volatility, spot price).
So this number is used for earnings (profit or loss) but also to monitor traders and their limits (a huge hit in one category would mean something is wrong).
Hope this helps.