In Tableau, a rank is computed as a table calc, which is solely based on what's brought into the view. If we have 20 states in the view, Tableau will give each of those states a rank, but if we filter our data down to one single state, Tableau won't remember the other 19 states because they're no longer in the view. We'll therefore always see a rank of 1 regardless of that state's performance compared to all other states.
Let's take the example below, where we see regions ranked by profit (the Rank calc on Columns is a simple table calc: RANK(SUM(Profit),'desc')). Note that South is ranked 3rd.

If we remove South using the filter on the right, Central is moved to 3rd place because Tableau recomputes Rank without South in the view, meaning we lose important information about the greater context:

We see this explained in the image below, which shows Tableau's order of operations. In red, we have our roadblock: dimension filters (Region, in our example) are processed before table calcs (Rank, in our example). In green, we have our solution: tell Tableau to compute rank first and subsequently filter out regions from the view.

Our one-calc solution looks like this:

The syntax works as follows: Lookup() returns the value of a row, indicated as an offset relative to the current row. In our case, we've provided an offset of 0, meaning that this calc will simply return us the value of the current row for Region. That sets the foundation for our new and upgraded dimension filter.
It's always important to be deliberate when building solutions and to understand how everything comes together in the background. Here, Lookup() isn't necessarily special for what it computes; it rather helps us satisfy Tableau's order of operations and obey the same computation order as our original Rank calc.
When we add New Rank to the filter card and remove South from the view, we see ranks 1, 2, and 4, meaning our context of South's rank is maintained.

This trick has important caveats, because Tableau's rank function will always compute as a table calc. First and foremost, this New Rank functionality will break if your worksheet or dashboard uses anything above table calcs in Tableau's order of operations (e.g., context/dimension/measure filters). To preserve a rank while filtering, you're safe to add more filters as long as they're implemented as table calc filters. Additionally, table calcs have Compute Using settings that, if configured incorrectly, can present a view that doesn't align with your intended analysis. That means if your Rank calc and New Rank calc have different Compute Using settings, this functionality will not behave as expected.
There you have it! Always important to give credit where it's due, so thanks to Darpan Bajaj for being my resource when I was figuring this out: https://www.youtube.com/watch?v=BlUXs9u51NI

