I changed your Top rows Filter to use a parameter. (Not crucial, but useful to a user.)
For Sheet 3 I created 2 calcs. One does a simple window_sum. the other does a window sum using the parameter. You want the one that uses a parameter. I put both on there to show the difference. When you use a table calc for a filter (and INDEX() is a table calc function), then you aren't filtering out rows in the table, you are filtering out what gets displayed. That's why the simple table calc comes up with such a huge number. The good one uses the same table calc logic that the filter does to sum up only the values you want to see.
Using that table calc approach, you need to do the same for all the measures you want to aggregate.
Then, look at sheet 4. On Sheet 3 you'll notice that the table calc displays the same value for each row. So on sheet 4 I just want to show one of the rows. I don't need the Top Rows Filter for this sheet. Just do Index=1. Take out the SUM(measure) for each measure and replace it with the table calc. And if you don't want to see City and segment, etc., then uncheck "Show Header" for those dimensions like you see in sheet 5.
Top N rows Total 3.twbx 1.2 MB