Average order value with DIVIDE and COUNTROWS

Reuse a measure inside another one, count rows, and divide safely so empty results never break your visuals.

You will learn to

  • Reference one measure from another
  • Count rows with COUNTROWS
  • Divide safely with DIVIDE

How it works

Measures can use other measures: write the name in square brackets, like `[Total Sales]`. Fix it once and every measure built on it updates.

`COUNTROWS(Sales)` counts the order lines that are visible right now.

`DIVIDE(a, b)` is the safe way to divide: when `b` is zero or blank it returns blank instead of an error.

Practice it hands-on with a real data model and a live report that updates as you type.

Units per Line = DIVIDE(SUM(Sales[Quantity]), COUNTROWS(Sales))