Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi. I have a table variable created using calculatetable in a dax measure. I need to rank this table based on column [Value]. I can do that with Rankx. However, it seemst that Rankx doesn't take the decimal points into consideration because I have two values (6.5 and 6.3) in the table, but it seems to give both of them the same rank. I was told that I should use Rank function to resolve this issue. However, it seems that Rank doesn't work with calculated table variables in a measure. Is there a way to make Rankx consider two decimal places? If not, will Rank work? Will it work on a table variable? Thanks.
Solved! Go to Solution.
Consider wrapping your measure results in a round function, with multiple decimal points (e.g. ROUND([Value],3), and RANKX from there. This was you can determine if it truly is a rounding issue (i.e. Rankx not picking up the decimals)
Proud to be a Super User! | |
Consider wrapping your measure results in a round function, with multiple decimal points (e.g. ROUND([Value],3), and RANKX from there. This was you can determine if it truly is a rounding issue (i.e. Rankx not picking up the decimals)
Proud to be a Super User! | |
Thanks, @ExcelMonke . You are right. I mistakenly thought that it truncated the decimals. When I dug deeper, I found that both numbers were identical, so the ranks were also identical. The problem now is that i'm later selecting from that table that has several rows with two of them having the same rank. The problem is in the next step where i select the top 5 values based on their ranks. So, I go like "give me the value where rank is 1; give me the value where rank is 2, ... where rank is 5." If the table has the below values, then I will be getting A, B, C, D and F as items with ranks 1, 2, 3, 4, 5 -- when I really should be getting E instead of F because E has a value of 7, but E is 6. I mean, it makes a difference in the context of the report.
ID | Value | Rank |
A | 10 | 1 |
B | 9 | 2 |
C | 8 | 3 |
D | 7 | 4 |
E | 7 | 4 |
F | 6 | 5 |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
68 | |
44 | |
38 | |
29 |
User | Count |
---|---|
156 | |
92 | |
61 | |
44 | |
42 |