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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Best row based on two columns

I'd developing a Power BI report related to the sport cricket. Here's a few key terms.

 

Bowling = Throwing the ball at the batters. Equivalent to pitching in baseball.
Bowler = Player who bowls at the batters. Equivalent to the pitcher in baseball.
Runs = Total points socred against the bowler while he was bowling.
Wickets = Total number of opposition players who were out when the bolwer was bowling.

 

Suppose following is a sample data set for a 10 game career.

 

Game,Runs,Wickets
1,23,5
2,34,0
3,55,1
4,13,0
5,43,3
6,45,3
7,64,6
8,45,6
9,24,2
10,34,1

 

There's a term called 'Best Bowling' for a player. It's the game in which a bowler took most wickets while giving away fewest runs. What this essentially means is the top record(s) when first sorted DESC by wickets, then sorted ASC by runs.

 

In this sample data, there are two instances of MAX wickets: games 7 and 8. Between those, game 8 has fewer runs. So that's the bowler's best performance. In a case where in both games runs were equal as well (say, both at 64), then both records are considered best performances. This value is generally displayed in the following format:

 

45/6

 

I would like to create a measure where it goes through the career record of a player and find the best bowling performance and displays it in the above format. What's the best way to go about it?

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

2 REPLIES 2
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1611881677917.png

 

Anonymous
Not applicable

That worked, thanks!

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.