Quick answer: create a calculated field with:
MEDIAN([Exam Score])
Or drag a measure to the view, right-click it and choose Measure > Median. MEDIAN ignores nulls and works only on numbers. This post covers four ways to find the median in Tableau. Looking for a related calculation? See how to calculate percentiles in Tableau.
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:

You can download the data and my workbook.
Why is MEDIAN not available? (and the fix)
On live connections to Microsoft SQL Server, MySQL, Amazon Redshift, Teradata, IBM DB2, SAP HANA, Access, Vertica, Netezza and Cloudera Hadoop, MEDIAN isn’t available. Those databases have no median function for Tableau to call. Fix: Data > [your source] > Extract Data, then use MEDIAN on the extract.
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 in how to calculate percentiles in Tableau: PERCENTILE([Sales], 0.5) returns the median.
Method 3: WINDOW_MEDIAN
Use this when you want the median of values already shown in the view, such as the median of monthly sales:
WINDOW_MEDIAN(SUM([Sales]))
It’s a table calculation, so set Compute Using to the dimension you’re looking across. To compare each month to the median, use SUM([Sales]) - WINDOW_MEDIAN(SUM([Sales])).
Method 4: Median reference line or box plot
In the Analytics pane, drag Median with Quartiles (or Reference Line, with aggregation Median) onto the view. You can also 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:

Median per category with an LOD
{ FIXED [Region] : MEDIAN([Sales]) }
This returns each region’s median at row level, so you can compare individual orders against it.
FAQ
What is the median function in Tableau?
MEDIAN(expression). It returns the middle value of a numeric field and ignores nulls.
Why is MEDIAN greyed out?
Your live database doesn’t support it. Switch to an extract.
What’s the difference between MEDIAN and WINDOW_MEDIAN?
MEDIAN works on row-level data. WINDOW_MEDIAN works on aggregated values already in the view.
Is PERCENTILE 0.5 the same as the median?
Yes. PERCENTILE([Sales], 0.5) returns the median.
Is the median on the Tableau Desktop Specialist / Desktop Foundations exam?
Aggregations, including median, appear in Exploring & Analyzing Data. Practice with our Desktop Specialist practice questions. For calculations at the next level, see our Data Analyst exam questions on calculations. Need to fix an axis in your median chart? Learn how to change the axis range.