Most Salesforce reporting problems are not report problems. They are data-model problems wearing a reporting costume, and refining margin is the clearest example there is.
Decide what “margin” means before you build anything
Margin is not one number in refining. Gross margin, net margin, crack-spread-based margin, and cash margin all answer different questions, and stakeholders will use the same word to mean different things.
Before a single report is built, get the definitions written down and agreed, what's included, what's excluded, at what point in the process. A dashboard that computes the wrong margin quickly is worse than no dashboard, because people will trust it and act on it.
Get the cost side into the model, not just revenue
Salesforce is comfortable with revenue and shaky with cost, which is why refining margin reporting so often stalls. Feedstock cost, processing cost, and yield all live in operational and ERP systems, and margin is meaningless without them.
You don't necessarily need to replicate all of it into Salesforce, but you do need the cost figures that margin depends on to arrive reliably and at the right grain. Decide early what comes in, at what level, and how often.
Match the grain of revenue and cost
The quiet killer of margin reporting is mismatched granularity. If revenue is per shipment and cost is per month, any margin you calculate by dividing one by the other is a fiction.
Pick the level at which margin is genuinely meaningful, by product, by batch, by period, and make sure both revenue and cost are available at that same grain before you combine them. Mismatched grain produces numbers that look precise and are quietly wrong.
Handle timing and accruals honestly
Refining revenue and cost don't land in the same period cleanly. Feedstock is purchased before the product is sold; prices move in between. If your margin report ignores this timing, it will swing wildly for reasons that have nothing to do with the business.
Build in the accrual and period logic that the finance team already uses, rather than inventing a simpler version in Salesforce that finance will reject the first time the numbers disagree.
Make the number traceable
When a refining margin figure looks wrong, and someone will always say it looks wrong, the report has to let them trace it back to the underlying shipments, costs, and assumptions.
A margin dashboard that can't be drilled into won't be trusted, and untrusted reports get replaced by the spreadsheets they were supposed to retire. Build the path from the summary number down to the records, because that path is what earns the report its authority.
Keep the calculation in one place
When margin logic is duplicated across reports, formula fields, and a few analysts' spreadsheets, the versions drift and nobody knows which is right.
Centralize the calculation, in a well-defined set of fields or a single reporting layer, so there's one definition of margin that everything else references. One trustworthy number beats five convenient ones that don't agree.
The takeaway
Trustworthy refining margin reporting depends on agreeing what margin means, bringing cost into the model at the right grain, respecting timing, and making every number traceable to its source. The tooling is rarely the constraint. The work is in the definitions and the data model beneath them, get those right and the reports become straightforward; get them wrong and no visualization will save you.
