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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Marico
Helper II
Helper II

Repeated rank = 1 using Rank function

Hello All,

 

I am creating the summarized table with the following measure:

 

Summarised students =

  CALCULATETABLE(

        SUMMARIZE(

            Students,

            Students[StudentName],

            "TotalScore",sum(Students[Score]))

      )

After creating this table, I am trying to Rank the students based on their scores in descending order through the following Column/ Measure:

 

StudentRank = RANKX(ALL(Students[StudentName]),CALCULATE(sum(Students[TotalScore])),,DESC,Dense)

 

StudentName

TotalScoreRank
S1901
S2981
S3961
S4911
S5991

 

I want to rank them correctly and then select Top 3 from the above list.

 

Thank you so much for your help!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Marico , You do not need summarize table for that , or create measure on that and use with columns of that table

 

StudentRank = RANKX(ALL('Summarised students'[StudentName]),CALCULATE(sum('Summarised students'[TotalScore])),,DESC,Dense)

 

 

For TOPN

AverageX(keepfilters(topn(3, all('Summarised students'[StudentName],CALCULATE(sum('Summarised students'[TotalScore])), desc)),CALCULATE(sum('Summarised students'[TotalScore])) )

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Marico , You do not need summarize table for that , or create measure on that and use with columns of that table

 

StudentRank = RANKX(ALL('Summarised students'[StudentName]),CALCULATE(sum('Summarised students'[TotalScore])),,DESC,Dense)

 

 

For TOPN

AverageX(keepfilters(topn(3, all('Summarised students'[StudentName],CALCULATE(sum('Summarised students'[TotalScore])), desc)),CALCULATE(sum('Summarised students'[TotalScore])) )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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