Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to match score to rank?

Hello everyone,

 

Sorry it might be an easy question, but I haven't found a quick solution for that.

If I have a list of students

+--------+----+
| Tom | 62 |
+--------+----+
| Chad | 97 |
+--------+----+
| Sherry | 53 |
+--------+----+
| Jim | 72 |
+--------+----+
| Kate | 89 |
+--------+----+
| Smith | 66 |
+--------+----+

 

And I have a ranking table

+-----+-----+------+
| Min | Max | Rank |
+-----+-----+------+
| 0 | 60 | F |
+-----+-----+------+
| 60 | 80 | C |
+-----+-----+------+
| 80 | 90 | B |
+-----+-----+------+
| 90 | 100 | A |
+-----+-----+------+

 

Is there an easy way in DAX to match the score to rank?

 

Thanks in advance!

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Anonymous  This is a good question. It is very possible, let me know if you think the solution is easy or not. 

 

Here is my blog post explaining how to do what you're asking, which is basically an approximate lookup in DAX.

https://excelwithallison.blogspot.com/2020/06/dax-approximate-lookup.html

Just replace the bonus amounts in my example with the scores in your data. Let me know if you have any trouble implementing.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

2 REPLIES 2
AllisonKennedy
Super User
Super User

@Anonymous  This is a good question. It is very possible, let me know if you think the solution is easy or not. 

 

Here is my blog post explaining how to do what you're asking, which is basically an approximate lookup in DAX.

https://excelwithallison.blogspot.com/2020/06/dax-approximate-lookup.html

Just replace the bonus amounts in my example with the scores in your data. Let me know if you have any trouble implementing.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Thank you. Glad you have an almost exact same use case

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.