ORDERBY DAX Function (Filter)
The expressions and order directions used to determine the sort order within each partition. Can only be used within a Window function.
Syntax
Parameter | Attributes | Description |
---|---|---|
OrderBy_Expression | Optional Repeatable |
An expression used to determine the sort order. |
OrderBy_Direction | Optional Repeatable |
Specifies how to sort OrderBy_ColumnName values. It is a two-part value of the form OrderDirection [BlankHandling]. OrderDirection specifies how to sort orderBy_expression values (i.e. ascending or descending). Valid values include:
BlankHandling part is optional. It specifies how blanks are ordered. Valid values include:
|
Return values
This function does not return a value.
Remarks
This function can only be used within a window function expression (INDEX, OFFSET, WINDOW).
Related articles
Learn more about ORDERBY in the following articles:
-
Introducing window functions in DAX
In December 2022, DAX was enriched with window functions: INDEX, OFFSET, and WINDOW. This article introduces the syntax and the basic functionalities of these new features. » Read more
-
Preparing a data model for Sankey Charts in Power BI
This article describes how to correctly shape a data model and prepare data to use a Sankey Chart as a funnel, considering events related to a customer (contact, trial, subscription, renewal, and others). » Read more
-
Introducing the RANK window function in DAX
RANK is a new DAX function to rank items based on multiple columns. This article introduces the RANK function and its differences with RANKX. » Read more
-
Introducing VISUAL SHAPE for visual calculations in Power BI
This article introduces the VISUAL SHAPE clause, which defines a hierarchical structure for a table used in visual calculations. » Read more
-
Using EXPAND and COLLAPSE in visual calculations
This article provides examples of visual calculations where the use of EXPAND and COLLAPSE is required to obtain the correct result. » Read more
-
Understanding apply semantics for window functions in DAX
This article explains the unique behavior of apply semantics: a new way of computing table expressions when multiple rows are selected in DAX window functions. » Read more
Related functions
Other related functions are:
Last update: Dec 4, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo, Daniil Maslyuk
Microsoft documentation: https://learn.microsoft.com/en-us/dax/orderby-function-dax