🎉 Your CoinMarketCap coupon is ready. Select a plan below and your 30% discount will apply at checkout.

How to Track Gain or Loss in Notion

Trading logs only become useful when you can see the dollars you actually made (or lost). In our Notion Investment Tracker tutorial and the Investment Portfolio Tracker template, every sell order is matched back to its original buy so you can surface realized gains instantly. This short walkthrough shows how to recreate that logic inside any Notion database.

1. Define the core properties

Create the following columns in your transactions database:

  • Type: Select property with at least two options: Buy and Sell. This tells the formula how to treat the row.
  • Linked Buy: Relation property pointing back to the same database. Every Sell entry links to the Buy it is closing.
  • Buy Price: Rollup on the Linked Buy relation. Set the rollup to pull the Price property (or whatever field stores your purchase price) using the Show original option.

2. Add the Gain/Loss formula

Create a new Formula property named Gain/Loss and paste the expression below. It calculates profit only on rows marked Sell, leaving Buy rows blank.

if(
  prop("Type") == "Sell",
  (prop("Price") - toNumber(format(prop("Buy Price")))) * prop("shares"),
  ""
)
Track Gain or Loss in Notion

How it works:

  • prop("Type") == "Sell" ensures the math runs only for sell orders.
  • prop("Price") reads the current sale price from the row you're on.
  • toNumber(format(prop("Buy Price"))) converts the rollup (which sometimes returns text) back into a number.
  • Multiplying by prop("shares") returns total profit or loss for that block of shares.

Frequently Asked Questions

Yes. The Gain/Loss formula relies on the relation to retrieve the original buy price. Each sell should link to the buy it closes. If you sell in multiple lots, create separate sell rows and link each one to the appropriate buy.

Related Posts

How to Create Notion Investment Tracker: Stocks, Crypto & More! hero

How to Create Notion Investment Tracker: Stocks, Crypto & More!

Explore Related Topics

Leave a Comment