ROWNUMBER DAX Function
Returns the unique rank for the current context within the specified partition sorted by the specified order or on the axis specified.
Syntax
Parameter | Attributes | Description |
---|---|---|
Relation | Optional |
A table expression where the RANK is computed. If omitted, OrderBy must be explicitly specified. |
OrderBy | Optional |
Columns that define how each partition is sorted. If omitted, Relation must be explicitly specified. |
Blanks | Optional |
Defines how to handle BLANK OrderBy values. Valid values include: DEFAULT, FIRST, LAST. |
PartitionBy | Optional |
Columns that define how Relation is partitioned. |
MatchBy | Optional |
Columns that define how the current row is identified. |
Reset | Optional |
Specifies how the calculation restarts. Valid values are: None, LowestParent, HighestParent, or an integer. |
Related articles
Learn more about ROWNUMBER in the following articles:
-
Computing accurate percentages with row-level security in Power BI
This article shows how to compute ratios when row-level security hides some of the data. If the percentage also includes the hidden rows in the comparison, you should customize the data model and the measures involved to get the right result. » Read more
-
SQLBI+ updates in May 2023
In 2023, we released the first draft of the Window functions in DAX whitepaper as part of SQLBI+. Since then, we have released a few updates and are now glad to announce the availability of the related 3-hour video course… » Read more
Last update: Dec 4, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://learn.microsoft.com/dax/rownumber-function-dax