DAX Docs

TopN

Table
Adds calculated columns to table expression.

Parameters

n_value -> Number
Number or DAX expression that returns a number.
table -> Table
Table from which rows need to be pulled.
order_by_expression -> Any
DAX expression that is used to sort the table.
order -> Number
Defines sort order. 0 (default) for descending order and 1 for ascending order.

Returns

Type: Table
Table with n_value rows.

Details

Examples

The following formula returns table with top 5 employees with highest current salary followed by checking earlier date of joining if there are ties
= TOPN( 5 Employee, "CurrentSalaray", 0 "DateOfJoining", 1 )