Weighted average
Choose a meaningful weight
A weighted average gives observations influence proportional to an exposure, quantity or other explicit weight. Here realized unit revenue is revenue divided by units sold, not an average of line prices. Use the isolated model in labs/business-kpis/README.md. All amounts are fictional USD, with costs stored as positive expenses. Three complete sales months (January–March 2025), monthly Periods, two Products, single-direction active relationships to both facts, no RLS. Examples are independent measure definitions unless labeled otherwise. Native DAX is not executed. All purchase lines have positive quantity; a zero-quantity zero-revenue administrative record is deliberately retained. Returns, rebates and negative units would require a separate business policy.
Example 1 — Weighted unit economics
Units = SUM(Sales[Units])Realized Unit Price = DIVIDE([Revenue], [Units])Contribution Per Unit = DIVIDE([Contribution], [Units])Across A, nine units generate 450, so realized price is 50. Across B, two units generate 150, so price is 75. The total is 600 / 11 = 54.55 (rounded); contribution per unit is 155 / 11 = 14.09. The B record in March has no units and returns BLANK for both unit measures.
Example 2 — Compare an unweighted line average
Mean Line Price =AVERAGEX(Sales, DIVIDE(Sales[RevenueUSD], Sales[Units]))Five positive-unit lines have prices 50, 100, 50, 50 and 50. Their mean is 60; the zero-unit row yields BLANK and is not included in the numeric average. A weighted sum of line prices would use SUMX over positive-unit lines and then divide by their units; direct revenue/units avoids rounding intermediate prices. This works because the zero-unit record has zero revenue. If a zero-unit service fee has nonzero revenue, allocate or exclude it under a documented rule before interpreting the price.
Common mistakes — wrong weight
A mean of monthly prices gives a low-volume month equal influence to a high-volume one. A mean of product prices answers a different question from realized price per unit. Never replace a missing or zero weight by one simply to get an answer. Carry full precision in measures and round for display. Negative weights from returns can make interpretation difficult; separate gross sales and returns or define net-unit economics explicitly.
Practice — Compare January and March
Compute weighted and unweighted line prices in January and March. For March B, explain the blank price. Check that summing contributions and units before dividing reproduces the combined KPI.