RANK.EQ - DAX Guide
Có thể bạn quan tâm
Returns the rank of a number in a column of numbers. If more than one value has the same rank, the top rank of that set of values is returned.
Syntax
RANK.EQ ( <Value>, <ColumnName> [, <Order>] )| Parameter | Attributes | Description |
|---|---|---|
| Value | The value to be ranked. | |
| ColumnName | A column in which the value will be ranked. | |
| Order | Optional | The order to be applied. 0/FALSE/DESC – descending; 1/TRUE/ASC – ascending. If omitted, the default is descending. |
Return values
Scalar A single integer value.
A number indicating the rank of Value among the numbers in ColumnName.
Remarks
The following RANK.EQ calls:
RANK.EQ ( <value>, table[column] ) RANK.EQ ( <value>, table[column], <order> )correspond to the following RANKX calls:
RANKX ( SELECTCOLUMNS ( table, table[column] ), table[column], <value> ) RANKX ( SELECTCOLUMNS ( table, table[column] ), table[column], <value>, <order> )The <value> placeholder is a DAX expression executed in the filter context where RANK.EQ is evaluated. The <order> placeholder is the optional order argument, which is descending by default.
» 1 related functionExamples
-- RANK.EQ find the ranking of a value in the column -- passed as second argument. The column values are sorted -- according to the third argument (default DESC). DEFINE TABLE SampleData1 = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 } TABLE SampleData2 = { 20, 40, 60, 80, 100, 10, 30, 50, 70, 90 } EVALUATE { ( "RANK.EQ ASC 1", RANK.EQ ( 70, SampleData1[Value], ASC ) ), ( "RANK.EQ ASC 2", RANK.EQ ( 70, SampleData2[Value], ASC ) ), ( "RANK.EQ DESC 1", RANK.EQ ( 70, SampleData1[Value], DESC ) ), ( "RANK.EQ DESC 2", RANK.EQ ( 70, SampleData2[Value], DESC ) ), ( "RANK.EQ 1", RANK.EQ ( 70, SampleData1[Value] ) ), ( "RANK.EQ 2", RANK.EQ ( 70, SampleData2[Value] ) ) }| Value1 | Value2 |
|---|---|
| RANK.EQ ASC 1 | 7 |
| RANK.EQ ASC 2 | 7 |
| RANK.EQ DESC 1 | 4 |
| RANK.EQ DESC 2 | 4 |
| RANK.EQ 1 | 4 |
| RANK.EQ 2 | 4 |
| Value1 | Value2 |
|---|---|
| RANK.EQ | 4 |
| RANKX | 4 |
| RANK.EQ ASC | 7 |
| RANKX ASC | 7 |
| Value1 | Value2 |
|---|---|
| RANK.EQ ASC | 1 |
| RANK.EQ ASC | 2 |
| RANK.EQ ASC | 5 |
| RANKX ASC | 5 |
| RANK.EQ | 7 |
| RANK.EQ | 4 |
| RANK.EQ | 3 |
| RANKX | 3 |
Related functions
Other related functions are:
- RANKX
Last update: Dec 17, 2025 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber, Jorge Esteves
Microsoft documentation: https://docs.microsoft.com/en-us/dax/rank-eq-function-dax
2018-2025 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us » Privacy Policy & Cookies Accept cookies to show this video. Cookies PolicyAllow all cookiesCompatibility
DirectQuery Measures Calculated columns- Power BIv13.0.1700.1022 →v17.0.44.19Current release
- Excelv11.0.9165.1186 →v16.0.9.17
- Excel 2016
- Excel 2019
- Excel Microsoft 365
- SSAS Tabularv11.0.2100.60 →v17.0.25.22
- SSAS 2012
- SSAS 2014
- SSAS 2016
- SSAS 2017
- SSAS 2019
- SSAS 2025
- SSAS Tabular
- Azure ASv14.0.1.501 →v17.0.41.18Current release
- SSDTv14.0.1.432 →v16.0.70.21Current release
» Show verified builds
First release
Before 2017-01-01
Context TransitionThis function performs a Context Transition if called in a Row Context. Click to read more.
Row ContextThis expression is executed in a Row Context. Click to read more.
Passed by ExpressionThis parameter is passed by expression and can be evaluated multiple times in different evaluation contexts.
Iterator Not recommendedThe use of this function is not recommended. See Remarks and Related functions for alternatives.
Not recommendedThe use of this parameter is not recommended.
DeprecatedThis function is deprecated. Jump to the Alternatives section to see the function to use.
VolatileA volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.
DeprecatedThis parameter is deprecated and its use is not recommended.
DirectQuery compatibilityLimitations 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 RANK.EQ? 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.I agree to the SQLBI Privacy Policy.
SubmitTừ khóa » Hàm Rank.eq
-
RANK.EQ (Hàm RANK.EQ) - Microsoft Support
-
Hàm RANK.EQ - Hàm Trả Về Thứ Hạng Của Một Số Trong Một Danh ...
-
How To Use The Excel RANK.EQ Function - Exceljet
-
Chia Sẻ Cách Sử Dụng Hàm Rank.eq Trong Excel
-
Xếp Hạng Theo điều Kiện Trong Excel - Phần 1
-
Hàm RANK Trong Excel Và Các ứng Dụng - Es-Glocal
-
Hàm Rank Trong Excel - Các Ví Dụ Về Cách Sử Dụng ... - Ben Computer
-
Hàm RANK Dùng để Làm Gì? Hướng Dẫn Sử Dụng Hàm RANK
-
Xếp Hạng Kết Quả Trong Excel Trong 1 Phút Với Hàm RANK
-
Excel RANK.EQ Function
-
Sử Dụng Hàm RANK Trong Excel để Xếp Hạng, Bạn đã Biết Cách?
-
Cách Sử Dụng Hàm RANK Trong Excel để Xếp Hạng Nhanh Chóng
-
How To Use The RANK.EQ Function In Google Sheets - InfoInspired