TOPNSKIP DAX Function (Table manipulation)

Retrieves a number of rows from a table efficiently, skipping a number of rows. Compared to TOPN, the TOPNSKIP function is less flexible, but much faster.

Syntax

TOPNSKIP ( <Rows>, <Skip>, <Table> [, <OrderBy_Expression> [, [<Order>] [, <OrderBy_Expression> [, [<Order>] [, … ] ] ] ] ] )
Parameter Attributes Description
Rows

Number of rows to return

Skip

Number of rows to skip

Table
Iterator

Table expression made by physical columns of the data model that are not grouping the cardinality of the original table they belong to.

OrderByExpression
Row Context
Optional

Expression used to define the sort order of the result

Order Optional

It can be ASC or 1 or TRUE to consider the OrderByExpression in an ascending order.
It can be DESC or 0 or FALSE to consider the OrderByExpression in a descending order.
If omitted, the default is descending (DESC).

Return values

Table An entire table or a table with one or more columns.

The table returned is not sorted, it is just filtered according to the required parameters.
The sort order of the result depends on the ORDER BY condition of EVALUATE.

Remarks

If Skip is not 0, the Table expression must reference physical columns with lineage and does not support a filter context coming from context transition.

If there is a tie, in OrderBy_Expression values, at the N-th row of the table, then all tied rows are returned. Then, when there are ties at the N-th row the function might return more than n rows.

If N_Value is 0 (zero) then TOPN returns an empty table.

TOPNSKIP does not guarantee any sort order for the results.

Related articles

Learn more about TOPNSKIP in the following articles:

Last update: Dec 28, 2020   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

2018-2021 © SQLBI. All rights are reserved. Information coming from MSDN is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of TOPNSKIP? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.