In your RG’s data source search make sure to sort it base on the criteria you need. And … you can add input elements or arrow up/down icons to be clicked and change the sort logic of the RG.
I know … the above is easier said than done.
I suggest you review youtube videos, the bubble forum for past posts on this, and bubble academy resources … on repeating groups, filterting, sorting, adding/substracting items from lists.
The following videos are particularly very instructive for your use case >