Finance KPI

Gross Margin Formula

Learn what Gross Margin means, how to calculate it in Excel, and how to recreate the same KPI as a Power BI DAX measure.

💡 Ideas for You

Resources related to this KPI and spreadsheet reporting.

4 useful links
📚 Step-by-step booksStart with beginner-friendly step-by-step books and learning resources from Create & Learn.📊 KPI dashboard resourcesBooks and templates for building finance KPI dashboards in spreadsheets.📈 Business metrics booksReferences for understanding finance metrics, definitions, and reporting habits.📘 Excel reporting guidesGuides for turning spreadsheet calculations into clear reports and dashboards.

Quick answer

Gross Margin is calculated as:

(Revenue - Cost of Goods Sold) / Revenue

Use this Excel version when your inputs are on row 2:

=IFERROR((B2 - C2) / B2,0)
Example result40.0%
FormatPercentage
Typical chartLine chart for trends; bar chart for comparing teams, channels, products, or locations.

What is Gross Margin?

Gross Margin measures how much of a result is left after a specific cost or expense is removed. In finance reporting, it helps beginners see whether activity is creating value or just increasing volume.

Finance KPIs help you understand profitability, cash flow, liquidity, debt, and whether the business is creating value after costs.

Beginner tip: A KPI is not just a formula. It is a number used to make a decision. Before adding it to a dashboard, write down the definition, time period, owner, target, and data source.

Real-life example

Imagine a finance analyst reviewing the monthly management report. The team adds the inputs for Gross Margin to a monthly finance dashboard, calculates the KPI for the current month, and compares it with the previous month and target. In the sample below, the result is 40.0%. That number becomes useful when everyone uses the same formula each month.

Excel cellInputWhat it meansSample value
B2Revenuemoney earned before or after the relevant adjustment, depending on the KPI definition$120,000
C2Cost of Goods Soldthe cost included in the calculation for the same period as the output$72,000
ResultGross MarginOutput of the KPI formula40.0%

How to calculate Gross Margin in Excel

  1. Create one row per reporting period, team, product, campaign, location, or customer segment.
  2. Add one input per column. Do not combine inputs in the same cell.
  3. Paste the Excel formula in the KPI result column.
  4. Format the result as Percentage.
  5. Copy the formula down the table and compare the result against target, previous period, and trend.
Quality check before publishing:
  • Use the same date range for every input.
  • Confirm that the denominator is not blank or zero.
  • Document whether the KPI is calculated before or after discounts, refunds, taxes, returns, or cancellations.
  • Keep the definition stable so reports remain comparable over time.

Power BI DAX measure

If you also report this KPI in Power BI, create a measure instead of hard-coding the calculation in a visual. Replace the measure names below with the names used in your model.

Gross Margin = DIVIDE(([Revenue] - [Cost of Goods Sold]), [Revenue], 0)

For best results, build base measures first, such as revenue, cost, customers, orders, or tickets, and then build the KPI measure from those base measures.

How to read the result

Higher is usually better, because this KPI normally represents revenue, efficiency, quality, retention, productivity, or successful outcomes.

Do not read the KPI alone. A single value can be misleading without a target, trend, segment, and business context. For example, the same result may be good for one product line but poor for another.

Useful comparisons

  • Current month versus previous month.
  • Actual result versus target or budget.
  • By channel, product, customer segment, team, or location.
  • Rolling average over several periods to smooth one-off spikes.

Common mistakes

  • Mixing time periods, such as monthly cost with quarterly revenue.
  • Using a total when the KPI should be segmented.
  • Changing the formula definition after the dashboard is already in use.
  • Comparing two teams that collect the inputs differently.
  • Ignoring blanks, zeros, refunds, cancellations, or duplicate records.