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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Kuri_190
Regular Visitor

Trying To create a raking for FIFA23

Hello all,

 

Hope this message finds you well and please take into account I'm new to Power BI.

 

I'm looking at some "fake" FIFA 23 data (provided via Kaggle) and I'm trying to create a table that shows me who are the best players to play at specific position. Every player has a best position to play (with the best overall skill), however they can play anywhere in the field and they have a skill level for every position they can play. For example, if player A is better on a Striker Position, his skill value on that position is 91, however he can also play has a midfielder but his skill will be 78; and so on.

 

With this information I want to create multiple tables(one for each position) that ranks every player skill value for a particular position, however I'm having a real hard time doing that. I'm trying to use the Rankx and Summarize DAX fucntions, but I tried multiple things. It never works.

 

Here's a sample of the table that comes from power query:

 

PlayerBest PositionSkillSkill ValuePositonPosition Value
MbappeSTPace Total97CAM92
MbappeSTPassing Total90CAM92
MbappeSTDribbling Total92CAM92
MbappeSTPace Total97CB57
MbappeSTPassing Total90CB57
MbappeSTDribbling Total92CB57
MessiCAMPace Total81CAM91
MessiCAMPassing Total90CAM91
MessiCAMDribbling Total94CAM91
MessiCAMPace Total81CB53
MessiCAMPassing Total90CB53
MessiCAMDribbling Total94CB53

 

Here's what I'm looking for:

 

PlayerPositionPositon ValueRanking
MbappeCAM921
MessiCAM912
MbappeCB571
MessiCB532

 

After getting a table with this, I can filter with the position on the visual side of the final table.

 

Here's my current formula for rankx

 

Rank Player =
CALCULATE(
    RANKX (
        SUMMARIZE(
            players_fifa23,
            players_fifa23[Name],
            players_fifa23[Position],
            players_fifa23[Position Value]
        ),
         
        players_fifa23[Position Value]
    )

)
 
Here's the error that shows on Power BI:
 
A single value for column 'Position Value' in table 'players_fifa23' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
 
I've used average for this, but the value that I get is the average of all players for every position and the rank is 1 for all the players.
 
Maybe this is a simple question and I might have missed something on the fundamentals, but I'm not being able to get the desired result. Thanks for reading!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Kuri_190 ,

Please try below steps:

1. create a measure with below dax formula

Ranking =
VAR cur_position =
    SELECTEDVALUE ( 'Table'[Positon] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Positon] = cur_position )
RETURN
    RANKX ( tmp, CALCULATE ( MAX ( 'Table'[Position Value] ) ),,, DENSE )

2. add a table visual with measure and fields

vbinbinyumsft_0-1664504714808.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Kuri_190 ,

Please try below steps:

1. create a measure with below dax formula

Ranking =
VAR cur_position =
    SELECTEDVALUE ( 'Table'[Positon] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Positon] = cur_position )
RETURN
    RANKX ( tmp, CALCULATE ( MAX ( 'Table'[Position Value] ) ),,, DENSE )

2. add a table visual with measure and fields

vbinbinyumsft_0-1664504714808.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors