Power BI DAX MEDIAN function

The Power BI MEDIAN function is one of the DAX aggregate functions useful to find the median of the numbers in a given column. This article explains the POWER BI DAX MEDIAN function to calculate the median (average of middle two for even and middle value for odd) and returns a decimal number and the syntax is shown below:

MEDIAN(<Column>)

The MEDIAN function works only on numeric values and it doesn’t support text, string data, logical values, or date values. If the given column contains a blank value, the MEDIAN function will ignore them.

Power BI DAX MEDIAN function Example

We need a Measure to work with the MEDIAN function and to assign the product sales median. So, within the Home tab, click the New Measure button and rename it as SalesMedian. To demonstrate the Power BI DAX MEDIAN() function, we use the Sales column from the SuperStore Orders to obtain the median. 

SalesMedian = MEDIAN(Orders[Sales])

Please add the new SalesMedian Measure to the table report. Please don’t confuse it with the result of SalesMedian. For example, the Furniture Category has a total of 6128 products. Similarly, create two more measures to calculate the profit median and orders median. Please refer to the Aggregate and the function article for the remaining Power BI functions. For more Charts >> Click Here.

ProfitMedian = MEDIAN(Orders[Profit])

OrdersMedian = MEDIAN(Orders[Quantity])

The other option is to add the Profit to the table. Next, click the down arrow beside the Sum of Profit Measure and change the default aggregate from the Median as shown below.

Power BI DAX MEDIAN Function