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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lisam12
New Member

Get value from one column based on expression in another column

Hi all, I have two tables. My Admin Group table is a list of administrators with different values (such as sales, rebates, etc.). I have assigned a score to each administrator in this table based on how well they are performing. On top of that, administrators are grouped into classes based on their membership group so that similarly sized administrators can be compared to each other. 

I now have a second table, a Leaderboard. The Leaderboard is a distinct list of the Class IDs from my Admin Group table. Now, I have pulled the lowest score for each administrator (lowest=best, in this case), but I would rather the function return the name of the administrator. Right now it is just returning the score. How do I fix this? 
The function I am using is: 

Class Leader = CALCULATE(MIN('Admin Groups'[Score]),FILTER('Admin Groups','Admin Groups'[Class ID]=EARLIER('Leaderboard'[Class ID])))
Result:
lisam12_0-1643229888890.png

These numbers are correct. They are the lowest score for each class. However, I have tried changing to formula to: Class Leader = CALCULATE(MIN('Admin Groups'[Admin FullName]),FILTER('Admin Groups','Admin Groups'[Class ID]=EARLIER('Leaderboard'[Class ID])))
However, this just returns the alphabetic first within each class. 

How do I get the Admin FullName field that corresponds to the correct lowest score that is returned in the first function?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@lisam12 , Try a new column like

 

measure =
var _score = CALCULATE(MIN('Admin Groups'[Score]),FILTER('Admin Groups','Admin Groups'[Class ID]=EARLIER('Leaderboard'[Class ID])))
return
CALCULATE(MIN('Admin Groups'[Admin FullName]),FILTER('Admin Groups','Admin Groups'[Class ID]=EARLIER('Leaderboard'[Class ID])
&& 'Admin Groups'[Score] = _score))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@lisam12 , Try a new column like

 

measure =
var _score = CALCULATE(MIN('Admin Groups'[Score]),FILTER('Admin Groups','Admin Groups'[Class ID]=EARLIER('Leaderboard'[Class ID])))
return
CALCULATE(MIN('Admin Groups'[Admin FullName]),FILTER('Admin Groups','Admin Groups'[Class ID]=EARLIER('Leaderboard'[Class ID])
&& 'Admin Groups'[Score] = _score))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Worked perfectly! Thank you!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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