How can I use a Rank Function for calculating Top 5 in overall?

Hi Team,
I have a derived field like this below, I just want to calculated Top 5 details but I am unable to do that so any idea how can I do this?
The derived field - Measure Selection

from this derived field I want to use Rank function but I am getting error message continuously so what can I do please help me.
The Rank Function Field

Please give some idea.

@Biswajit_1993, you can correct the syntactical error using below syntax by adding square brackets before max function in your calculated field. Please refer to rank function guide

rank ( [max(Sales) ASC])