Sorry but Rank is a table calculation that is based on the underlying table for the worksheet in which it is used - it is also at the bottom of the order of operation and can not be used in an LOD expression - so the table needs to be in the sheet
Could you attach a sample of what you currently have and the end result?
Instead of Using Rank to show top 5,
Create a set for top 5 and use that top 5 set in another worksheet in filter --> Select IN --> Drag the measure you want the result will give the top 5 Values as Jim Dehner said rank is table calculation and underlying data will be available so with sets you can restrict the data and it will be useful to show top 5
Hope this helps kindly mark this answer as correct or helpful so that it will help others