RANKX(Table, Expression) ranks the current row against every row of a table, by the value of an expression:
Store Rank = RANKX(ALL(Store[Store]), [Total Sales])
The table is the list to rank against, so it needs ALL. With plain VALUES(Store[Store]) or Store, each store row only sees itself and every store ranks 1, the classic RANKX mistake.
Optional arguments: a value to rank (leave it empty), the order (DESC by default, ASC for smallest first), and ties: Skip (1, 2, 2, 4) or Dense (1, 2, 2, 3).
To rank within a group, rank against the group only: RANKX(ALLEXCEPT(Product, Product[Category]), [Total Sales]) ranks products inside their category. And the Total row gets a rank too, usually 1, which means nothing: wrap the measure in IF(HASONEVALUE(...), ...).