PERCENTILE.INC
A percentile of a column's values, k from 0 to 1.
Group: Statistics. Compatible with DAX.
Syntax
PERCENTILE.INC ( <column>, <k> )
| Parameter | Type | Description |
|---|---|---|
column | Column | A column of numbers. |
k | Number | The share of values below the result, from 0 to 1. |
Returns
Number. The k-th percentile of the column's values, blanks left out.
Remarks
- The smallest value sits at k = 0 and the largest at k = 1, the rest evenly between; a k that falls between two values gets a point on the straight line between them. This is Excel's PERCENTILE.INC and R's quantile of type 7.
PERCENTILE.INC ( column, 0.5 )is the median.- Blank cells are left out here; in
PERCENTILEX.INCa blank result counts as zero. - A k below 0 or above 1 is an error. Dates, text and TRUE/FALSE are errors; with no value the result is BLANK.
Examples
Quartiles of the crates per place
EVALUATE
ROW (
"Q1", PERCENTILE.INC ( Places[Crates], 0.25 ),
"Median", PERCENTILE.INC ( Places[Crates], 0.5 ),
"Q3", PERCENTILE.INC ( Places[Crates], 0.75 ),
"90th", PERCENTILE.INC ( Places[Crates], 0.9 )
)
| Q1 | Median | Q3 | 90th |
|---|---|---|---|
| 9 | 11.5 | 14 | 15.5 |
Median price by category
EVALUATE
SUMMARIZECOLUMNS (
Products[Category],
"Median price", PERCENTILE.INC ( Products[Price per liter], 0.5 )
)
ORDER BY Products[Category]
| Products[Category] | Median price |
|---|---|
| Beer | 38 |
| Cider | 52 |