Revenue, Cost & Profit
Revenue is not profit. Walk one month of a coffee shop from money-in to the bottom line, defining every word — COGS, gross margin, opex, operating profit — as it appears.
What you'll learn
- Revenue, COGS, and gross profit — and why gross margin is a percentage
- Fixed operating expenses (opex) vs the cost of each sale
- Operating profit and net profit — the real bottom line
- Why a business can have big revenue and still lose money
Before you start
The last lesson ended on a deceptively simple question: is revenue the same as profit? The owner above already knows the answer is no — $20,000 came in, and almost none of it stayed. This lesson is the map that explains where the rest went.
Every analyst, founder, and investor reads a business from that same map: money flows in at the top, costs get subtracted one layer at a time, and whatever survives is profit. The map has names — revenue, COGS, gross profit, opex, operating profit, net profit — and once you have the vocabulary, you can read any business in minutes.
Let’s walk one month of a single coffee shop and define every term the moment it shows up.
Revenue — the top line
Revenue (also called sales or top line — because it sits at the very top of every financial report) is the total money a business receives from selling its product or service before any costs are taken out.
For our coffee shop:
- Price per coffee: $4.00
- Coffees sold in the month: 5,000
- Revenue = $4.00 x 5,000 = $20,000
That’s it. No costs subtracted yet. Revenue is purely money in from customers.
COGS — the cost of each sale
COGS stands for cost of goods sold: the direct cost to produce each unit that was sold. For a coffee shop those are the ingredients that go into every cup.
- Beans + milk + cup per coffee: $1.20
- 5,000 coffees sold
- COGS = $1.20 x 5,000 = $6,000
COGS scales with volume. Sell twice as many coffees and COGS roughly doubles. That’s what makes it a “variable” cost — it moves with output, unlike a fixed cost such as rent, which stays the same no matter how much you sell.
Gross profit and gross margin
Subtract COGS from revenue and you get gross profit: what’s left after paying for the things you actually sold.
Gross profit = Revenue − COGS = $20,000 − $6,000 = $14,000
Analysts usually express this as a percentage called gross margin — where margin means a profit figure expressed as a fraction of revenue, so you can compare businesses of different sizes.
Gross margin = Gross profit ÷ Revenue = $14,000 ÷ $20,000 = 70%
A 70% gross margin means every dollar of revenue leaves 70 cents to cover everything else (rent, staff, taxes) and still turn a profit. High gross margins give a business room to breathe; thin ones leave almost nothing for the layers below.
Operating expenses (opex) — the fixed running costs
So far we’ve only subtracted the cost of making the coffee. But the shop has other bills that come in every month regardless of how many cups are sold.
Operating expenses (opex) are the recurring costs of running the business that do not scale directly with each unit sold.
| Expense | Monthly cost |
|---|---|
| Rent | $4,000 |
| Staff wages | $7,000 |
| Utilities | $1,000 |
| Total opex | $12,000 |
Whether the shop sells 5,000 coffees or 4,000, rent is still $4,000. That fixed nature is the defining feature of opex.
Operating profit — what the business actually earns from operations
Operating profit (also called EBIT — earnings before interest and taxes — in formal accounting) is gross profit minus opex. It answers: after paying to make the product AND to run the business, how much is left?
Operating profit = Gross profit − Opex = $14,000 − $12,000 = $2,000
Out of $20,000 in sales, only $2,000 survives after production costs and running costs. That is a thin margin — and it explains exactly why the owner said “we barely made money.”
Net profit — the bottom line
Net profit (the bottom line — because it sits at the very bottom of the report) is what remains after every single cost, including interest on loans and income taxes.
For this simplified example, we will skip interest and taxes to keep the numbers clean. In that case:
Net profit ≈ $2,000
Net margin = Net profit ÷ Revenue = $2,000 ÷ $20,000 = 10%
A 10% net margin means the shop keeps 10 cents of every dollar it brings in. In the real world, tax and debt service would push this lower.
The full picture — one bar, three layers
The diagram below shows where the $20,000 goes. Every dollar of revenue is split across three destinations: COGS, opex, and profit. The revenue bar on the left splits into those three pieces on the right.
$20,000 revenue splits into three layers. Gross profit ($14,000) is revenue minus COGS. Operating profit ($2,000) is gross profit minus opex.
Key intuitions to lock in
- Revenue is the top line — money in, before any deductions.
- COGS scales with every sale; opex is mostly fixed.
- Gross margin (here 70%) is the breathing room above operating costs.
- Operating profit is the number that shows whether the core business is viable.
- Net profit (the bottom line) is what remains after everything — taxes, interest, all of it.
- The gap between top line and bottom line is filled entirely by costs. Understand the costs and you understand the business.
Vocabulary recap
| Term | One-line definition |
|---|---|
| Revenue | Total money received from sales |
| COGS | Direct cost to produce each unit sold |
| Gross profit | Revenue − COGS |
| Margin | A profit expressed as % of revenue |
| Gross margin | Gross profit ÷ Revenue |
| Opex | Fixed running costs (rent, staff, etc.) |
| Operating profit | Gross profit − Opex |
| Net profit | Final profit after all costs including tax |
| Top line | Revenue |
| Bottom line | Net profit |
In one breath
A business is a stack, read top to bottom. Revenue ($20,000) is money in before any cost. Subtract COGS — the per-unit cost of what you sold ($6,000) — and you get gross profit ($14,000), which as a percentage of revenue is the gross margin (70%). Subtract opex — the fixed running costs that don’t move with each sale, like rent and wages ($12,000) — and you get operating profit ($2,000), the number that says whether the core business actually works. Take out interest and tax and you reach net profit, the bottom line. The whole gap between top line and bottom line is just costs, layer by layer — which is why record revenue and a real loss can sit in the very same month.
Practice
Quick check
A question to carry forward
We just built that revenue-to-profit stack by hand, one subtraction at a time, for a single coffee shop. But every real company — the corner bakery, Apple, the startup down the road — has to report exactly this stack, every quarter, on one standardised page. They don’t get to invent their own layout.
So the question to carry forward is: what does this map look like when it’s a formal, published document with real-company line items on it? The next lesson reads a full income statement (the P&L) top to bottom — the same revenue → COGS → gross profit → opex → operating profit → net profit chain you now know, but with the rows, subtotals, and footnotes an analyst actually meets in the wild, and the two or three places companies quietly hide bad news.
Practice this in an interview
All questionsLAG accesses a value from a previous row within the partition; LEAD accesses a value from a following row. Both accept an optional offset (default 1) and a default value when the referenced row does not exist. They are the standard tool for period-over-period comparisons without a self-join.
Apply FinOps to ML by tagging every workload (training jobs, endpoints, GPU pools) by team, model, and environment so cost is attributable, then track unit-economics metrics like cost per prediction or per training run rather than just total spend. Set budgets and alerts, identify idle GPUs and overprovisioned endpoints, and enforce guardrails like autoscaling and instance-type policies. The goal is continuous visibility and accountability so teams optimize cost without killing experimentation.