This post will explain three ways to calculate the median in Tableau. Let’s get started!
Method 1: Use the MEDIAN function
First create a new calculation by selecting Analysis > Create Calculated Field:
Next write using the syntax MEDIAN(expression). The expression should be just the name of the field for which you’d like the median. In my example, I will calculate the median exam score.
Median is an aggregation function, so summarizes the exam scores.
You can see that I get the same value if I used the Median function in Excel:
Method 2: Use Percentile
The median is another term for the 50th percentile, so one way to calculate the median to calculate the 50th percentile, as shown here.
Method 3: Create a Box-and-Whisker Plot
When you create a box plot, Tableau will calculate the median. First uncheck aggregate measures:
Add the field you’d like to find the median for to the viz.
Then select Box-and-Whisker on the show-me page:
When you mouse over the box-and-whisker plot, you’ll see the median value: