A DAX window function that gives the current row a unique position within a sorted, optionally partitioned table. Where the sort and partition columns leave a tie, it brings in more columns to settle it, and errors if there are none; RANK, by contrast, lets tied rows share a position.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains ROWNUMBER in context, with comparison tables and the common traps.
Terms in this definition
- DAX
Short for Data Analysis Expressions, the formula language you write measures, calculated columns and row-level security rules in, within tabular semantic models in Power BI, Excel Power Pivot or Analysis Services.
- Window function
A function evaluated OVER a window defined by PARTITION BY, ORDER BY and optionally a frame; unlike GROUP BY aggregation it doesn't collapse rows, but adds to each one a value worked out from its related rows. Examples are RANK, ROW_NUMBER, LAG and running totals.
- Event
Table in Log Analytics where entries from Windows event logs are kept.
- WHERE
Limits a SELECT, UPDATE or DELETE to just the rows meeting a condition. Omit it, and the statement hits every row.
- Azure AI Search partition
Storage and I/O unit of a search service, each holding part of the indexes. Adding partitions increases storage and indexing throughput; the number of search units equals replicas multiplied by partitions.
- RANK
A window function, found in T-SQL (used with OVER) and in DAX, that gives each row's position within its partition. In DAX it accepts ORDERBY and PARTITIONBY, skips ranks after ties unless DENSE is chosen, and returns blank for total rows.
- Share
In OpenSharing, the container you fill with tables, views, volumes, models and notebooks for recipients. You need
CREATE SHAREon the metastore to make one; add a schema and all its assets, including later ones, go with history.
Related terms
- MATCHBY
Used within DAX window functions such as OFFSET, WINDOW, INDEX, RANK and ROWNUMBER, this lists the columns that pin down which row is current when the data lacks a unique key.
- ORDERBY
Sets how rows are sorted within each partition. This DAX helper can only appear inside window functions like OFFSET, RANK or ROWNUMBER.
- Window functions
Calculate across rows related to whichever row is current, e.g. rankings or running totals. DAX provides OFFSET, WINDOW, INDEX, RANK and ROWNUMBER, partitioned and ordered through PARTITIONBY and ORDERBY; T-SQL uses OVER, applied once GROUP BY and HAVING finish.