You can use
Dense Rank
[
^]
According to MSDN:
Returns the rank of rows within the partition of a result set, without any gaps in the ranking. The rank of a row is one plus the number of distinct ranks that come before the row in question.
SELECT
ProductID,
Name,
LocationID,
Quantity,
DENSE_RANK() OVER (ORDER BY LocationID, Quantity ASC) AS Rank
FROM
Products
ORDER
BY LocationID, Quantity;