The INDEX() function is an example of what's called a table calculation in Tableau. The key to all table calculations is to set up the addressing and partitioning correctly, which can be confusing, especially without an example. Could you please mock up the data you are describing and post a packaged workbook?
For future reference, here's Shawn's trust Why Your Question Didn't Get Answered document. As Shawn mentions, the more setup work you do up front, the more likely the forum-answerers will be to help you!
This is actually fairly simple to do--see "Number 1-Filter without affecting results" in Jonathan Drummey's workbook here:
Basically, you just create a calculation like:
And put it on the filter shelf for any views you want to do this for. After that, the result of the INDEX() should return the results you want.