Forum Discussion
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:
| Season | Start of Week | Week |
| 2020/2021 | 08/08/2021 | 1 |
| 2020/2021 | 08/15/2021 | 2 |
| 2021/2022 | 08/07/2021 | 1 |
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 @AM45119You 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
Community 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
- Ashish_Mathur
Super User
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
Community 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 @AM45119You 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