Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Restarting RANKX Per Season in Soccer Report

So, I have a school project for a newer, never previously taught, class in college. For this assignment we are creating a data base for soccer information for the school, and one of the things the teacher wants us to try is having a condition that counts weeks of a season. My goal would be that the column gives each week a number using rankx, then the weeks go back to one come the 2021/2022 season. Is there any way to do this?

 

The columns should be:

SeasonStart of WeekWeek 
2020/202108/08/20211
2020/202108/15/20212
2021/202208/07/20211

 

 

  • Hi Anonymous Thanks for giving me a kudo. If you could kindly accept my submission as a solution, it would be greatly appreciated. This will allow others to know it's resolved and that they can use the topic as a source of information. Otherwise, please let me know if my solution doesn't work.

    Hi @AM45119 

     

    You can use the following to achieve the RANKX by season (new Calculated Column):

     

    RankBySeason = RANKX ( FILTER ( 'Table' , Table[Season] = EARLIER ( Table[Season] ) ) , Table[ColumnForRanking] )

     

    Just adjust Table name to suit yours and also add the relevant column you're using to rank in the last part of the formula.

     

    Hope this helps ðŸ™‚

     

     

    Theo

3 Replies

  • TheoC's avatar
    TheoC
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    You can use the following to achieve the RANKX by season (new Calculated Column):

     

    RankBySeason = RANKX ( FILTER ( 'Table' , Table[Season] = EARLIER ( Table[Season] ) ) , Table[ColumnForRanking] )

     

    Just adjust Table name to suit yours and also add the relevant column you're using to rank in the last part of the formula.

     

    Hope this helps 🙂

     

    Theo

  • Hi,

    This calculated column works

    Week = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Season]=EARLIER(Data[Season])&&Data[Start of Week]<=EARLIER(Data[Start of Week])))

    Hope this helps.

  • TheoC's avatar
    TheoC
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous Thanks for giving me a kudo. If you could kindly accept my submission as a solution, it would be greatly appreciated. This will allow others to know it's resolved and that they can use the topic as a source of information. Otherwise, please let me know if my solution doesn't work.

    Hi @AM45119 

     

    You can use the following to achieve the RANKX by season (new Calculated Column):

     

    RankBySeason = RANKX ( FILTER ( 'Table' , Table[Season] = EARLIER ( Table[Season] ) ) , Table[ColumnForRanking] )

     

    Just adjust Table name to suit yours and also add the relevant column you're using to rank in the last part of the formula.

     

    Hope this helps ðŸ™‚

     

     

    Theo