Calculated Measures in Business Intelligence
Calculated Measures in Business Intelligence turn recorded data into quantities that answer business questions. Revenue records alone do not tell you gross profit margin, average revenue per order, or the proportion of deliveries damaged. You define a calculation that gives these quantities a consistent meaning. A useful measure remains meaningful when a report displays one region, several regions, or the whole business.
Define the business quantity
A calculated measure is a named calculation that produces a summary value for a specified data context. Begin with the business question, then identify the inputs, aggregation, units, and exclusions. For example, gross profit subtracts cost of goods sold from revenue; it does not subtract every operating expense.
Suppose each sales record contains revenue and its associated cost of goods sold, expressed in the same currency. Define:
The sums cover the relevant records. Gross profit has currency units. Gross profit margin is a dimensionless ratio, usually displayed as a percentage. A stored result of 0.28 displays as 28%; percentage formatting does not require multiplying the stored ratio by 100 first.
A row calculation and a measure serve different purposes. Calculating revenue minus cost for each transaction creates transaction-level information. A measure summarizes the relevant transactions. You can sum transaction profits to obtain total profit, but you should not assume that every transaction-level calculation can be combined by addition.
Understand context and totals
The filter context is the set of restrictions used when evaluating a measure. A selected month, a region filter, and a product grouping can all contribute restrictions. Unless the measure explicitly changes those restrictions, its aggregates use the records allowed by that context.
Selecting a region therefore changes the records used in both gross profit and revenue. The measure definition stays the same, while its result can change. At a total across regions, the measure is evaluated again using the records allowed by the total's context.
Measure | Definition | Meaning of a combined total |
|---|---|---|
Gross profit | Revenue sum minus cost sum | Add profits from nonoverlapping groups |
Gross profit margin | Total gross profit divided by total revenue | Recalculate the ratio from combined amounts |
Average revenue per order | Total revenue divided by distinct order count | Recalculate using the relevant orders |
For gross profit margin, the combined ratio weights each group's margin by that group's revenue, provided the revenues are positive. A simple average gives equal weight to each group and answers a different question. If revenues are equal, the two methods agree; unequal revenues generally produce different results.
Validate the definition
Test a measure on a small set of records whose result you can check manually. Then test a filtered subset and a combined total. This checks the business meaning as well as the arithmetic.
For a ratio, numerator and denominator need compatible scope. Dividing one region's profit by that region's revenue gives its margin. Dividing the same profit by company-wide revenue gives a different quantity, even if both expressions run successfully.
Also define how exceptional inputs should behave. A zero denominator makes the ratio undefined. A blank or an unavailable label can communicate this; displaying zero would claim that a valid zero rate was observed. Missing cost data also differs from a recorded cost of zero. Document whether incomplete records are excluded, flagged, or handled through another stated business rule.
What to remember
- Define the business meaning, inputs, units, and exclusions first.
- Evaluate the measure using its applicable filter context.
- Recalculate ratios from their underlying totals.
- Treat zero denominators and missing inputs explicitly.
Example: Regional Gross Profit Margins
A kitchenware retailer is defining calculated measures in business intelligence for its monthly sales report. The following amounts summarize all sales records for two regions. Each sale belongs to exactly one region. Revenue and cost of goods sold are complete, use USD, and cover the same month. There are no other regions in the report.
Region | Revenue (USD) | Cost of goods sold (USD) |
|---|---|---|
Urban | 24,000 | 18,000 |
Rural | 6,000 | 3,000 |
The retailer defines gross profit as revenue minus cost of goods sold. It defines gross profit margin as gross profit divided by revenue.
Amounts should be reported in USD, and margins to one decimal place.
a) Define the two measures so that selecting a region changes the records used in each calculation.
Use the revenue and cost totals from the applicable report context. For each evaluation, both inputs must cover the same selected region and month.
Gross profit is an amount in USD. Margin is a dimensionless ratio displayed as a percentage. Both regions have positive revenue here, so each regional ratio is defined.
b) Find gross profit and gross profit margin when each region is selected separately.
For Urban, subtract its cost from its revenue, then divide the resulting profit by Urban revenue. The denominator must describe the same selected region as the numerator.
Apply the same definition to Rural using Rural's records.
Urban produces more gross profit in USD, while Rural retains a larger fraction of its revenue as gross profit. These are different measures of performance.
c) Calculate the combined margin. An analyst proposes displaying the simple average of the regional margins as the total. Evaluate that proposal.
With both regions included, first combine their underlying amounts. Because the regions do not overlap, their revenue and gross profit amounts can be added.
The analyst's simple average gives:
That calculation gives the regions equal weight. The combined margin instead weights them by revenue: Urban contributes 24,000/30,000=0.80 of revenue and Rural contributes 6,000/30,000=0.20.
The correct combined gross profit margin is 30.0%. Its position closer to Urban's margin is a useful check because Urban accounts for most of the revenue.
A business analyst is validating calculated fields before publishing a sales report. Match each error category to the description that identifies it. The reporting system requires numeric inputs for subtraction and does not automatically convert text into numbers.
An expression names GrossSales, but the dataset contains no column with that name.
Two derived columns each require the other column's result before either can be evaluated.
An expression has an opening parenthesis without its required closing partner.
A subtraction uses a text-valued customer category where a numeric value is required.
Type mismatch
Syntax error
Circular dependency
Missing field reference
A distributor inspects deliveries for damage. Every inspected delivery belongs to exactly one depot, and each delivery is counted once. During one month, Depot North has 6 damaged deliveries out of 30 inspected; Depot South has 27 damaged deliveries out of 270 inspected. The business wants the proportion of all inspected deliveries that were damaged. Which measure definition is appropriate?