In this example we place [City] into the detail level of the marks card.
Then we place SUM([Value]) onto text shelf of the marks card.
Right Click that field and go to create table calculation and choose 'Rank', the compute using section should be changed to
I went to Running Along and change this drop down to advanced
Next and I made sure everything I wanted to group by was on the left and everything I wanted to run along or rank by was on the right.
In my case I wanted to use state and country as these are levels of detail that matter to me ( I didn't want to group many several cities of the same name together).
This should now rank for every city with respect to the region its in.
Finally bring this calculated field onto the filters shelf and change the options to keep 'at most' 5.
RankingMap.twbx 1.2 MB
It's exactly what I was looking for.