Business Intelligence with Power BI

L05 · DAX I: Measures

Practice — Medium · Extending the Family

Skills focus. Writing new measures without a recipe — composition, iterators, and reading a measure table like an analyst.

Ungraded. Start from Mild's finished family. The tasks name the business question; you choose the DAX.

Tasks

  1. Basket size. Operations asks: "how many units does a typical order contain?" Build Avg Units per Order from measures you already have. Check: 3.033.
  2. Average line profit. Finance wants the average profit per order line: per row, quantity × (discounted price − unit cost), averaged across all lines. This needs an iterator and RELATED. Check: your value times 165,042 should land within rounding of Gross Profit — write down why that identity must hold.
  3. The margin table. Build a table visual: Category · Total Revenue · Gross Profit · Gross Margin %. Sort it three times — by revenue, by profit, by margin — and write one sentence per sort naming the leader.
  4. The rankings disagree. Revenue crowns Furniture; margin crowns Decor. Where does Gross Profit (the dollars, not the percent) crown? Look before you reason, then explain why profit-dollars lands where it does using the other two columns.
Hint — task 2's shape

AVERAGEX ( Sales, Sales[Quantity] * ( Sales[UnitPrice] * ( 1 - Sales[DiscountPct] ) - RELATED ( Products[UnitCost] ) ) ) — the iterator supplies row context; RELATED crosses to the product's cost inside it.

Reflection

  • Task 1 was one DIVIDE of existing measures; task 2 needed a fresh iterator. What property of the question decided which kind of construction was required?
  • Three sorts, three different "best" categories. When the VP asks "which category is doing best?", what is the honest first response?