Ranking Equal Values based on alternative parameters

@Melissa,

:clap:. Fantastic approach and great explanation. Much more efficient than the Table.Split approach I was thinking of. This actually puts us in great shape toward a solution, since looking at the order of tiebreakers:

image

the first two we can calculate based on the results of your approach, the third weā€™ve already calculated, the fourth is simple based on the data weā€™ve used for #3, and the last can be calculated easily through a Random.Number or RAND function call.

Once we got the web import working well, I think we can calculate all five tiebreakers in Power Query, and then all weā€™ll need to do is build out the logic to rank, determine if we have a tie, go to the next tiebreaker, re-rank, and keep repeating until we have only unique rankings for all teams.

Iā€™m thinking that logic would be built in DAX, but very open to a Power Query alternative.

As always, thanks a ton for your input and expertise.

  • Brian

Had to do a GroupBy TeamConcat to get the HtH Goals and Squad to get the Overall Goals, then broke out into another query to get the Total scored for each team in the Tie Pool.

Think weā€™re moving along nicely. Updated file below.
eDNA Forum - Ties an HtH Sol2.pbix (108.2 KB)

1 Like

@Melissa,

Fantastic. So, now we primarily just need the overall logic to apply the tiebreakers down to the level needed to produce only unique rankings.

@Anferrig - do you want to grab the baton and bring this one over the finish line?

  • Brian

Dear @Melissa @BrianJ

Thanks a lot for your amazing contribution, really fantastic. On my side still havenā€™t found the adequate time to seat, understand and catch up with the new solution proposed. Sorry about it. Plan to do it tonight, need to understand your ideas and techniques and try to apply them to the entire model. Will come back to you soon, I wish.

@BrianJ Yes, let me grab the baton, will try to move it further toward the finish line as much as I can

Talk to you soon

Thanks a lot :wink:

1 Like

@Anferrig,

No rush at all. This was your question, so whatever timeframe works for you is fine. Iā€™m sure @Melissa and I can find plenty of other questions to keep us busy in the interimā€¦ :wink:

  • Brian

Dear @Melissa @BrianJ

I spent some time on the data and would like to wrap up where I managed to arrive so far.

As a recap, besides the final draw, we have basically 5 subsequent criteria to calculate the Ranking, the main one is the Points gained, the alternative ones are these:
image

Unfortunately only Alternatives #3 and #4 can be obtained directly from the main ranking (Query TabRank):

Indeed to obtain alternatives #1 and #2 thereā€™s the need to work on Head to Head and evaluate the tie Pools (Query Same Ties):

To visualize the situation, I put red crosses where the criteria in the column is not sufficient and there is the need to evaluate the next one. Alternative #1 (Tie Pool Points) is enough for all the cases, besides the Same Tie 2, where also Alternative #2 is not sufficient and thereā€™s the need to evaluate Alternative #3 (Goals Difference Overall).

I posted here the whole file with the data connection and the tables shown. I think now we are a bit closer to the solution, but not sure if, having these to tables with the HtH information prepared, itā€™s time to move to DAX to build the complete Ranking (using some EARLIER construct as reviewed before) or thereā€™s still some elaboration needed in PQ.

I guess the PQ steps are not properly optimized as the file is pretty slow when elaborates. I was mainly focusing on understanding how to progress, maybe some efficiency can be done afterwards.

Here the tables involved in the calculations (sorry for the mess :slight_smile: )
image

Please let me know what you think

Thanks a lot

Ciao

Serie A 18-19 II.pbix (247.5 KB)

@Anferrig,

Sorry for the delay in responding. Been a crazy week at work, and this one is taking some time. Just wanted to let you know Iā€™m still working it and will get back to you soon.

  • Brian

Hello @BrianJ

thanks for your message, havenā€™t accessed the forum for a couple of days, hence sorry for my late replyā€¦ just to say, no worries, am not in rush at all :wink:

Have a nice day

Ciao