MEDIAN DAX Function (Statistical)

Returns the 50th percentile of values in a column.


MEDIAN ( <Column> )
Parameter Attributes Description

A column containing the values.

Return values

Scalar A single variant value.

Median value


Blanks are ignored. Only numeric data types are supported. Logical values, dates, and text columns are not supported.

The following MEDIAN call:

MEDIAN ( table[column] )

corresponds to the following MEDIANX call:


The result is blank in case there are no rows in the table with a non-blank value.

» 1 related article
» 1 related function


--  MEDIAN is the compact version of MEDIANX
--  MEDIANX returns the 50th percentile of an expression
--  evaluated row-by-row on a table.
    TABLE SampleData = { 2, 4, 4, 4, 5, 5, 7, 9 }
     ( "AVERAGE",  AVERAGE ( SampleData[Value] ) ),
     ( "MEDIAN",   MEDIAN ( SampleData[Value] ) ),
     ( "MEDIANX",  MEDIANX ( SampleData, SampleData[Value] ) ),
     ( "Average Sales", AVERAGEX ( Sales, Sales[Quantity] * Sales[Net Price] ) ),
     ( "Median Sales", MEDIANX ( Sales, Sales[Quantity] * Sales[Net Price] ) )
Value1 Value2
Average Sales 305.21
Median Sales 114.21

Related articles

Learn more about MEDIAN in the following articles:

  • Statistical Patterns

    DAX includes a few statistical aggregation functions, such as average, variance, and standard deviation. Other typical statistical calculations require you to write longer DAX expressions. Excel, from this point of view, has a much richer language. The Statistical Patterns are a collection of common statistical calculations: median, mode, moving average, percentile, and quartile. » Read more

Related functions

Other related functions are:

Last update: Jun 10, 2023   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Jes Hansen, Antti Komonen

Microsoft documentation:

2018-2023 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.


Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.


This function is deprecated. Jump to the Alternatives section to see the function to use.


A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.


This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.


Want to improve the content of MEDIAN? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.