I'm not 100% sure of your requirement, but have you tried dragging the rank calculation into the viz ? I've pictured it sorted on your Top Two Bands percentage as it was easier for me to understand the figures as a histogram.
With the rank calculation inside the viz canvas area, the ranks do not appear to be resorting when you change the sort on the school pill like you detailed in your question, I tried a few different sort options. I also hid it from the view so that it didn't affect your viz layout.
School sample.twbx 36.2 KB