MEDIAN DAX Function (Statistical)
Returns the 50th percentile of values in a column.
Syntax
Parameter | Attributes | Description |
---|---|---|
Column |
A column containing the values. |
Return values
Median value
Remarks
Only numeric values in the column are counted. Blanks, logical values, and text are ignored.
If there are no blanks, logical values, or text values, then the following MEDIAN call:
MEDIAN ( table[column] )
corresponds to the following MEDIANX call:
MEDIANX ( table, table[column] )
The result is blank in case there are no rows in the table with a non-blank value.
» 1 related function
Examples
-- MEDIAN is the compact version of MEDIANX -- MEDIANX returns the 50th percentile of an expression -- evaluated row-by-row on a table. DEFINE TABLE SampleData = { 2, 4, 4, 4, 5, 5, 7, 9 } EVALUATE { ( "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 | 5.00 |
MEDIAN | 4.50 |
MEDIANX | 4.50 |
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: Apr 2, 2021 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo, Jes Hansen
Microsoft documentation: https://docs.microsoft.com/en-us/dax/median-function-dax