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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DanieeelD
New Member

Applying Ranking to values within a Group

Hi All, 

 

Apologies bit of new starter with Power Bi and looking to get stuck in with learning to analyse my mates mini league 🙂

 

Using data retrieved from the Fantasy Premier League API I'm looking to rank manager's on a week by week basis. To do this I want to look at two columns, Event ID which is the week (i.e. 1) and Total Points. Example of the table structure can be seen below including what I would expect rank to show. 

ManagerEventTotal PointsRank
Manager AWeek 1501
Manager BWeek 1302
Manager CWeek 1253
Manager AWeek 2802
Manager BWeek 2901
Manager CWeek 2603

 

This rank would then be needed to create a visual that shows the change in rank over time as the season progresses. However, I'm struggling to find the examples of how this might be done. I've tried creating a column using 

Rank per Event = RANKX(ALL('Manager Basic Info'[Event]), [Total Points]) but this just returns rank 1. Is it possible to create the ranking I need in Power Bi? Or do I need to extract each week's data into seperate tables and rank from there?
 
Thanks in advance, 
Dan 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DanieeelD ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1672813029131.png

2. please create a measure with below dax formula:

RK =
VAR cur_event =
    SELECTEDVALUE ( 'Table'[Event] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Event] = cur_event )
RETURN
    RANKX ( tmp, CALCULATE ( MAX ( 'Table'[Total Points] ) ) )

3. add a table visual with fields and measure

vbinbinyumsft_1-1672813101873.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

2 REPLIES 2
Anonymous
Not applicable

Hi @DanieeelD ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1672813029131.png

2. please create a measure with below dax formula:

RK =
VAR cur_event =
    SELECTEDVALUE ( 'Table'[Event] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Event] = cur_event )
RETURN
    RANKX ( tmp, CALCULATE ( MAX ( 'Table'[Total Points] ) ) )

3. add a table visual with fields and measure

vbinbinyumsft_1-1672813101873.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.

TomMartens
Super User
Super User

Hey @DanieeelD ,

this measure:

Measure = 
IF( ISFILTERED('Table'[Manager] ) 
    ,RANKX(
        ALLSELECTED( 'Table'[Manager] )
        , calculate( sum( 'Table'[Total Points] ) )
    )
    , BLANK()
)

allows to create this table visual:
image.png

Hopefully, this provides what you are looking for.

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors