Hi @marie9423498
— you’re definitely on the right path, and this is a great use case.
You’re correct that the formula for % Gross Profit is simple:
(Gross Profit / Revenue) * 100
However, the challenge comes from implementing that in HubSpot’s Custom Report Builder, especially when you’re working with Deals + Line Items.
Why This Is Tricky in HubSpot
HubSpot doesn’t currently support dividing one aggregated metric by another (e.g. sum of margin ÷ sum of revenue) directly in the Custom Report Builder unless you have formula fields available.
Also, calculated properties can’t be created for Line Items, and calculated fields at the Deal level can’t reference associated Line Items natively.
Your Options
1. Use Formulas in Custom Report Builder (if your account supports it)
If you see an “Add formula” button in the Custom Report Builder:
-
Add
Sum of MarginandSum of Total Contract Valueto the report -
Click Add formula and enter:
([Sum of Margin] / [Sum of Total Contract Value]) * 100 -
Name it
Gross Profit %, format as percentage
That’ll do exactly what you’re looking for — a real-time calculation in the report.
2. External Calculation via API or Workflow
If formulas aren’t available in your account, consider this workaround:
-
Create a custom property on the Deal object (e.g.,
Gross Profit %) -
Use a third-party tool (Zapier, Make, or custom API script) to:
- Fetch the total margin and revenue from associated Line Items
- Calculate Gross Profit %
- Push it back to the Deal property
Then you can report on the property normally.
3. Export & Calculate in Excel or Google Sheets
Classic fallback:
- Export the data from your existing report
- Use a pivot table to group by month
- Create a column that does:
=Margin / Revenue * 100
Summary
| Option | Description | Best For |
|---|---|---|
| Formula in Custom Report Builder | Build the % field right inside the report | If using Enterprise tiers or Reporting Add-on |
| API or Integration | Push pre-calculated % into a Deal property | If you have developer resources |
| Excel/Sheets | Calculate manually post-export | For quick monthly snapshots |
Hope that helps! Let me know your HubSpot tier if you’re unsure whether formulas are available — happy to confirm what’ll work best for your setup. ![]()