PERCENT_RANK
Shows a row's relative position from 0 to 1: what share of the other rows comes before it.
Syntax
PERCENT_RANK() OVER (ORDER BY <sort key>)
PERCENT_RANK() OVER (PARTITION BY <group> ORDER BY <sort key>)
Calculates (rank − 1) / (rows − 1): the first in order gets 0, the last gets 1. Handy for saying “earns more than 75% of colleagues”. The similar CUME_DIST calculates the share including the current row and never gives 0.