Build a Weighted Margin Calculation
Create a Tableau margin percentage that totals correctly.
Define margin at the displayed level The correct beginner pattern for weighted ratios is aggregate the numerator and denominator separately, then divide. In Tableau, SUM([Profit]) / SUM([Sales]) answers “profit as a share of sales” at whatever level the view is displaying. AVG([Profit]/[Sales]) answers “average order-level margin,” which is a different metric. The common beginner shortcut is to keep adding fields until the chart looks interesting. That usually changes the question, the grain, or the calculation without anyone noticing. Name the metric Margin % - weighted = profit share of sales A clear name warns users this is not an average…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in