RankX in PowerBI can be tricky. It's very particular to the context of the table and any slicing function. Additionally, defining expressions will also require finetuning.
RankX: returns the ranking of a number in a list of numbers for each row in the table argument.
Documentation: https://docs.microsoft.com/enus/dax/...