Median or average: which one should your report show?

The average and the median answer different questions, and one big value can move the average a long way. When to show which, a worked example, and the DAX for both.

Short answer: show the median when a few very big or very small values could pull the number away from what is typical: order values, salaries, delivery times, house prices. Show the average (the mean) when every value should count by its size, like total cost per order across a budget. If the two are far apart, your data is skewed, and the median is the better "typical" value. In DAX they are MEDIAN and AVERAGE.

A box plot is built around the median for a reason: it is the middle value, and one outlier cannot move it. A KPI card that shows only the average can hide that most customers wait two days while a few wait three weeks.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

How far can one value move the average?

Nine support tickets, closed in hours:

010203040502T13T23T34T44T55T65T76T848T9
Hours to close nine tickets (made-up help desk)

The average is (2 + 3 + 3 + 4 + 4 + 5 + 5 + 6 + 48) ÷ 9 = 80 ÷ 9 = 8.9 hours. The median, the fifth of nine sorted values, is 4 hours. Eight of the nine tickets closed in 6 hours or less, so "typically about 4 hours" is the honest summary, and the one slow ticket deserves its own look.

When is the average the right number?

QuestionUseWhy
What does a typical customer wait?MedianOne very slow case should not move "typical"
What is the typical order value?MedianA few huge orders pull the average up
What does each order cost us on average, to plan the budget?AverageEvery euro counts, the big ones too
What is the average daily revenue this month?AverageTotals divided by days, used to forecast

A good rule: if you would multiply the number back up to a total, use the average. If you want to describe one typical item, use the median.

How do you write them in DAX?

Avg Hours = AVERAGE ( Tickets[HoursToClose] )
Median Hours = MEDIAN ( Tickets[HoursToClose] )

Both respect the filters on the page, so a slicer for a team gives that team's median. To compute over a measure per item instead of a column, use the iterator versions AVERAGEX and MEDIANX.

What goes wrong?

  • Only the average on the card. Show both, or the median with the average in the tooltip, when the data is skewed.
  • Deleting the outlier to fix the average. The 48-hour ticket is real; report the median and investigate the ticket.
  • Averaging averages. The average of five store averages is not the company average when stores differ in size.

Where can you check this?

Where do you start?

To see the whole spread instead of one number, see what is a histogram and AVERAGEX, MINX and MAXX. All statistical functions are in the DAX statistical functions reference.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.