POWER BI: Modeling

Statistical Functions

Median functions

The median is the middle value or the 50th percentile of a data set. To quickly calculate the median in Power BI without DAX formulas refer to this section on summarizing data.

There are two types of median functions

  • MEDIAN(column)
  • MEDIANX(table,expression)
MEDIAN
Example Formula:

Find the median revenue of sales:

                  median_revenue = MEDIAN(TransactionData[Revenue])
	            
MEDIANX

Use when you want to find the median of an expression

Example 1:

Find the median for the profit:

                median_x = MEDIANX(TransactionData,TransactionData[Revenue]-TransactionData[Cost])
	            

Example 2:

Find the median for profit given that the profit is less than $100.

                 median_profit | profit < 100 = MEDIANX(
                         FILTER(TransactionData,(TransactionData[Revenue] -TransactionData[Cost])<100),
                         TransactionData[Revenue]-TransactionData[Cost])
	           
  • A filter function is used to return a temporary table that contains only profit values under $100
  • The last row is the expression that gets returned.
Power BI Demo:

The functions used above are plotted in Power BI to compare



Dash-Intel is a Power BI and Tableau resource site for data visualization and building BI dashboards.

Data Analyst & Consultant

Copyright 2015-2023 Dash-Intel.com Terms