List.Median
ListReturns the median value of a list.
Syntax
List.Median(list as list, optional comparisonCriteria as any) as anyParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list of values to evaluate. |
comparisonCriteria | any | No | A comparer or key selector for custom ordering. |
Return Value
any — The median value of the list. For even-length lists of numbers, returns the arithmetic mean of the two middle values.
Remarks
List.Median returns the middle value of a sorted list. For numeric lists with an even number of elements, it returns the average of the two middle values. For non-numeric lists, it returns the lower middle value.
Null values are ignored. If the list is empty or contains only nulls, null is returned.
Examples
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks