What is gross margin?
Gross margin is the percentage of revenue a company keeps after covering the direct cost of producing its goods or services. It isolates production profitability from operating costs, taxes, and financing, which is why finance teams use it to compare products, track pricing power, and watch cost trends over time. A widening gross margin signals pricing strength or falling input costs; a narrowing one is an early warning.
How to calculate gross margin
Gross Margin % = (Revenue – COGS) / Revenue
Worked example:
- Revenue: $5,000,000
- Cost of goods sold: $3,000,000
- Gross profit: $2,000,000
- Gross margin: 2,000,000 / 5,000,000 = 40%
Gross profit is the dollar figure ($2M). Gross margin is the ratio (40%). Both come from the same two inputs, so both are only as accurate as how cleanly revenue and cost are mapped.
Gross margin in Power BI (DAX)
The exact measure depends on your data model. Replace the table and column names with the ones in your model:
Total Revenue = SUM ( Sales[Revenue] )
Total COGS = SUM ( Sales[COGS] )
Gross Margin % = DIVIDE ( [Total Revenue] - [Total COGS], [Total Revenue] )
DIVIDE returns a blank instead of an error when revenue is zero. Format the measure as a percentage.
What is a good gross margin?
A healthy gross margin depends on the industry. Software and services run high because the direct cost of delivery is low; distribution, manufacturing, and construction run lower because materials and labor sit inside the cost of goods sold. The number worth watching is the trend. A margin sliding quarter over quarter usually points to rising input costs or pricing pressure, well before it reaches net income.
Gross margin vs net margin
Gross margin stops at direct production cost. Net margin subtracts everything else, including operating expense, interest, and taxes, so it is always lower. Use gross margin to judge how profitably you produce, and net margin to judge what reaches the bottom line. For the broader practice of analyzing margins across products and periods, see Yield / Margin Analysis.
Common gross margin reporting pitfalls
Gross margin breaks when cost is allocated inconsistently, when revenue and cost of goods sold are pulled from different periods, or when each system calculates it its own way. In environments with more than one ERP, the same product can carry a different cost in the ERP, the warehouse, and the BI report, so the margin depends on which source someone trusted.
Reporting gross margin from your ERP data
Gross margin is only as reliable as the ledger and cost data feeding it. When revenue and cost of goods sold live in separate ERP modules, or across systems after an acquisition, a governed data foundation maps them once so every report reads the same number. QuickLaunch ships pre-built models for JD Edwards, Vista, NetSuite, and OneStream that surface revenue, cost, and margin from source data without hand-built spreadsheets.
Frequently Asked Questions
How is gross margin calculated?
Subtract the cost of goods sold from revenue, then divide by revenue. A company with $5M revenue and $3M cost of goods sold has a 40% gross margin.
What is the difference between gross margin and gross profit?
Gross profit is the dollar amount left after cost of goods sold; gross margin is that amount as a percentage of revenue.
What is a good gross margin?
It varies by industry. Software runs high, distribution and construction run lower. The trend over time matters more than the absolute number.