MEDIANX

Updated on

MEDIANX is a DAX function that returns the 50th percentile of values resulting from evaluating an expression for each row in a table.

Syntax

MEDIANX(
   Table,
   Expression
)
Argument Properties Description
Table Table over which the Expression will be evaluated.
Expression Expression to evaluate for each row of the table.

Return Values

A decimal number.

Remarks

  • The MEDIANX function takes as its first argument a table, or an expression that returns a table. The second argument is a column that contains the numbers for which you want to compute the median, or an expression that evaluates to a column.

  • Only the numbers in the column are counted.

  • Logical values and text are ignored.

  • MEDIANX does not ignore blanks; however, MEDIAN does ignore blanks

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following computes the median age of customers who live in the USA.

= MEDIANX( FILTER(Customers, RELATED( Geography[Country]="USA" ) ), Customers[Age] )

Other functions related to MEDIANX are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/medianx-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy