Forum Discussion
Create a ranking column on a Table Visual with DAX
- 3 years ago
HI Anonymous
Understood! Please try the following Measures. It includes a small workaround (second measure). From my understanding the challenge we have is to prioritize points and if points are equal then we have to look on the GD, right?
Your Base table
first I built a measure only using points for ranking
RANK Table (only Points) = RANKX( ALL(RankingTable[Name]), CALCULATE(SUM(RankingTable[Points])) )NOw for adding the GD as a second priority I used a small trick by adding the SUM of GD and dividing it by 100 so that you get for sorting [POINTS],([GD]/100). As long the sum of GD can not be higher 100 it works. when GD can become higher, then you can also multiple 1000 or more.
RANK Table (Points and GD) = RANKX( ALL(RankingTable[Name]), CALCULATE(SUM(RankingTable[Points]) + SUM(RankingTable[GD])/100) )There might be a better solution but I am a little bit on the run but wanted to give you a solution. 🙂
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
-----------------------------------------------------
Hi Anonymous
If I udnerstood correctly you can simply use the Index Column feature in Power QUery:
your base table:
now you should have a column which you can use for sorting
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
-----------------------------------------------------
- Anonymous3 years agoNot applicable
Hello Mikelytics , This sort of does not answer, I have a visual table. That I have , this limits the work to be done on DAX only...
- Mikelytics3 years ago
Resident Rockstar
HI Anonymous
Understood! Please try the following Measures. It includes a small workaround (second measure). From my understanding the challenge we have is to prioritize points and if points are equal then we have to look on the GD, right?
Your Base table
first I built a measure only using points for ranking
RANK Table (only Points) = RANKX( ALL(RankingTable[Name]), CALCULATE(SUM(RankingTable[Points])) )NOw for adding the GD as a second priority I used a small trick by adding the SUM of GD and dividing it by 100 so that you get for sorting [POINTS],([GD]/100). As long the sum of GD can not be higher 100 it works. when GD can become higher, then you can also multiple 1000 or more.
RANK Table (Points and GD) = RANKX( ALL(RankingTable[Name]), CALCULATE(SUM(RankingTable[Points]) + SUM(RankingTable[GD])/100) )There might be a better solution but I am a little bit on the run but wanted to give you a solution. 🙂
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
-----------------------------------------------------
- Anonymous3 years agoNot applicable
This works perfectly. Thanks