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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Krijgersss
Helper II
Helper II

rankx measure based on points and name

Hello i need some help i use this measure to give everyone a rank :

RANKX(
    ALL(
        Tour_De_France_Poule[Tourploeg]),
        CALCULATE(
            SUM(
                Tour_De_France_Poule[Punten])
       
)



now is the problem that some people has the same amount of point so they wil get the same rank. i want this measure that if 2 people has the same amount of points it will look at the name and give the by name there rank so for example 

5 max  10
5 arjan 10

i want the answer to be 

5 Arjan 10
6 Max 10

because the A comes fore the M in the alpabet

1 ACCEPTED SOLUTION

@Krijgersss ,

 

My table name is ='Table'

And column contains name is ='Table'[Name]

And column containing point is ='Table'[Points]

 

Can you replace them with the name in your table and it will work or you can try renaming columns as per the details shared by me




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

9 REPLIES 9
bhanu_gautam
Super User
Super User

@Krijgersss , To achieve this you can use name as secondry criterion

 

Rank =
RANKX(
    ALL(Tour_De_France_Poule[Tourploeg]),
    CALCULATE(
        SUM(Tour_De_France_Poule[Punten])
    ) +
    RANKX(
        ALL(Tour_De_France_Poule[Tourploeg]),
        Tour_De_France_Poule[Tourploeg],
        ,
        ASC,
        DENSE
    ) / 1000000,
    ,
    ASC,
    DENSE
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






i  get this error by your formula 

Krijgersss_0-1719832539040.png

 

Can you share sample data for testing or convert this error in english translation




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






A single value for column 'Tourploeg' in table 'Tour_De_France_Poule' cannot be determined. This can happen when the formula of the measure refers to a column that contains many values and no aggregation such as minimum, maximum, count, or sum has been specified to yield a single result.

in the screenshot is example of the data how it looks now

Krijgersss_0-1719835367062.png

 

Here is the updated codewith PBIX fileand it is working created a new column using

 

Rank =
VAR CurrentName = 'Table'[Name]
VAR CurrentPoints = 'Table'[Points]
RETURN
    RANKX(
        FILTER(
            'Table',
            'Table'[Points] = CurrentPoints
        ),
        'Table'[Name],
        ,
        ASC,
        DENSE
    ) +
    RANKX(
        ALL('Table'),
        'Table'[Points],
        ,
        DESC,
        DENSE
    ) - 1



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






i have 1 error in your formula it doesnt reconize my tabel with points called "Tour_De_France_Poule[Punten]"

it is correctly spelled

Krijgersss_0-1719837364618.png

 

@Krijgersss ,

 

My table name is ='Table'

And column contains name is ='Table'[Name]

And column containing point is ='Table'[Points]

 

Can you replace them with the name in your table and it will work or you can try renaming columns as per the details shared by me




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






i tryed it but it gives me the same error as before 

A single value for column 'Tourploeg' in table 'Tour_De_France_Poule' cannot be determined. This can happen when the formula of the measure refers to a column that contains many values and no aggregation such as minimum, maximum, count, or sum has been specified to yield a single result.

You must be adding measure go to modelling tab and add new column 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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