<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DAX for ranking based on 3 columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3340508#M125367</link>
    <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="565196" data-lia-user-login="rubayatyasmin" class="lia-mention lia-mention-user"&gt;rubayatyasmin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the direction. I realized I skipped the summarization step and that was why my ranking attemps did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i your approach I experience a new trouble. I use 2 slicers to filter the content and the result od the table summarization is statis - does not reflect the filters from the slicers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two slicers offer following filtering options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Tournament type&lt;BR /&gt;table 'List of tournaments'[Tournament type]: value "only main player" when all players are main players, value "not only main players" when at least one player is not a main player&lt;/LI&gt;&lt;LI&gt;Combined 4-level slicer:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;table 'List of seasons'[Attendees]: men vs. mixed (men+women)&lt;UL&gt;&lt;LI&gt;'List of seasons'[Season type]: summer vs. winter&lt;UL&gt;&lt;LI&gt;'List of seasons'[Season]: Season unique name, e.g. Summer season 2023&lt;UL&gt;&lt;LI&gt;'List of tournaments'[Date]: date of the specific tournament, e.g. 17/07/2023&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please do you have any idea how to keep considering the filters from two slicers above to the summarized table used for ranking calculation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can send you .pbix file if you prefer, but all the texts inside are in Czech langugage (different to what I state in this post, where I transafer the names of the tables and columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 09:44:19 GMT</pubDate>
    <dc:creator>albrecht</dc:creator>
    <dc:date>2023-07-20T09:44:19Z</dc:date>
    <item>
      <title>DAX for ranking based on 3 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3333200#M124957</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to solve a simple task but I am not able to find a solution by my own so I kindly ask you for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Context: I am creating a statistics for beachvolleyball. There are about 20 tounaments every season. Every tournament 4 players compete, based on the their score (sets won minus sets lost) players got tournament standing - for example 1st for the best player, 2.5 for two players sharing the 2nd and 3rd place and 4th for the loser. The list of 4 players attending the tournaments differ tournament by tournament. There is 5 "main" players for which the statistics are created, the other players are just "guests". I am preparing the seasonal stats aggregation the results of all the tournaments. The seasonal standing is calculated based on the 3 dimensions:&lt;/P&gt;&lt;P&gt;1. average tournament standing (ASC)&lt;/P&gt;&lt;P&gt;2. (when no. 1 equals among two or more players, then) number of the best tournament standings minus number of the worst tournament standings (DESC)&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;(when no. 2 equals among two or more players, then) number of sets won minus number of sets lost (DESC)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;"Tournaments" table containg for every player for every tournament at least following (M language transformations):&lt;/P&gt;&lt;P&gt;- [Player name] column as String&lt;/P&gt;&lt;P&gt;- [Player type] as String: "main player" or "guest"&lt;/P&gt;&lt;P&gt;- [Player standing] as Decimal&lt;/P&gt;&lt;P&gt;- [Player result] as Integer: 1 = tournament winner, 2 = middle, 3 = tournament loser&lt;/P&gt;&lt;P&gt;- [Sets won - sets lost] as Integer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I created following DAX meaures in the same table "Tournaments"&lt;/P&gt;&lt;P&gt;- [1. Average standing] = average of&amp;nbsp;[Player standing] column for every player&lt;/P&gt;&lt;P&gt;- [2. Player results agg] = count of "1" in&amp;nbsp;[Player result] column minus&amp;nbsp;count of "3" in&amp;nbsp;[Player result]&amp;nbsp;for every player&lt;/P&gt;&lt;P&gt;- [3. Sets won - sets lost agg] = sum of&amp;nbsp;[Sets won - sets lost]&amp;nbsp;for every player&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now I need the calculate the seasonal ranking of the players based on the 3 measures above.&lt;/STRONG&gt; It can be done as a single calculation or even separate rankings of all the 3 measures are fine for me as I am able to use a "proxy score" (10.000*Ranking based on the 1st measure - 1.000* Ranking based on the 2nd measure - Ranking based on the 3rd measure) and the get the final ranking of the players based on the proxy score ASC. In both cases, &lt;STRONG&gt;I need to calculate seasonal ranking for the group of main players separately, for the group of the guests separately and for both group together without considering main player vs. guest.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jakub Albrecht&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jul 2023 21:56:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3333200#M124957</guid>
      <dc:creator>albrecht</dc:creator>
      <dc:date>2023-07-16T21:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for ranking based on 3 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3334165#M125027</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366590" data-lia-user-login="albrecht" class="lia-mention lia-mention-user"&gt;albrecht&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;First, we need to create a table that will have a single row for each player, along with the necessary metrics. This can be achieved by using the &lt;/SPAN&gt;SUMMARIZE&lt;SPAN&gt; function in DAX.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then you need to use Rankx to get the seasonal ranking. In this step you should also get the proxy scores.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;now you have the proxy scores and seasonal ranking. So use RANKX again to get the final ranking.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To get the rankings separately for main players and guests, you can filter the SeasonalRanking table before calculating the final rank.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PlayerMetrics =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;Tournaments,&lt;BR /&gt;Tournaments[Player name],&lt;BR /&gt;Tournaments[Player type],&lt;BR /&gt;"Average Standing", [1. Average standing],&lt;BR /&gt;"Player Results Agg", [2. Player results agg],&lt;BR /&gt;"Sets Won - Sets Lost Agg", [3. Sets won - sets lost agg]&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;SeasonalRanking =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;PlayerMetrics,&lt;BR /&gt;"1st Measure Rank", RANKX(PlayerMetrics, [Average Standing], , ASC),&lt;BR /&gt;"2nd Measure Rank", RANKX(PlayerMetrics, [Player Results Agg], , DESC),&lt;BR /&gt;"3rd Measure Rank", RANKX(PlayerMetrics, [Sets Won - Sets Lost Agg], , DESC),&lt;BR /&gt;"Proxy Score", 10000 * [1st Measure Rank] - 1000 * [2nd Measure Rank] - [3rd Measure Rank]&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3.&amp;nbsp;FinalRanking =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;SeasonalRanking,&lt;BR /&gt;"Final Rank", RANKX(SeasonalRanking, [Proxy Score], , ASC)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FinalRankingMain =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;FILTER(SeasonalRanking, SeasonalRanking[Player type] = "main player"),&lt;BR /&gt;"Final Rank Main", RANKX(FILTER(SeasonalRanking, SeasonalRanking[Player type] = "main player"), [Proxy Score], , ASC)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;FinalRankingGuest =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;FILTER(SeasonalRanking, SeasonalRanking[Player type] = "guest"),&lt;BR /&gt;"Final Rank Guest", RANKX(FILTER(SeasonalRanking, SeasonalRanking[Player type] = "guest"), [Proxy Score], , ASC)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like this. I think it is enough to get an idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my assistance helped you in any way, hit&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 11:11:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3334165#M125027</guid>
      <dc:creator>rubayatyasmin</dc:creator>
      <dc:date>2023-07-17T11:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for ranking based on 3 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3340508#M125367</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="565196" data-lia-user-login="rubayatyasmin" class="lia-mention lia-mention-user"&gt;rubayatyasmin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the direction. I realized I skipped the summarization step and that was why my ranking attemps did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i your approach I experience a new trouble. I use 2 slicers to filter the content and the result od the table summarization is statis - does not reflect the filters from the slicers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two slicers offer following filtering options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Tournament type&lt;BR /&gt;table 'List of tournaments'[Tournament type]: value "only main player" when all players are main players, value "not only main players" when at least one player is not a main player&lt;/LI&gt;&lt;LI&gt;Combined 4-level slicer:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;table 'List of seasons'[Attendees]: men vs. mixed (men+women)&lt;UL&gt;&lt;LI&gt;'List of seasons'[Season type]: summer vs. winter&lt;UL&gt;&lt;LI&gt;'List of seasons'[Season]: Season unique name, e.g. Summer season 2023&lt;UL&gt;&lt;LI&gt;'List of tournaments'[Date]: date of the specific tournament, e.g. 17/07/2023&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please do you have any idea how to keep considering the filters from two slicers above to the summarized table used for ranking calculation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can send you .pbix file if you prefer, but all the texts inside are in Czech langugage (different to what I state in this post, where I transafer the names of the tables and columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 09:44:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3340508#M125367</guid>
      <dc:creator>albrecht</dc:creator>
      <dc:date>2023-07-20T09:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for ranking based on 3 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3340649#M125380</link>
      <description>&lt;P&gt;try this one.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;PlayerMetrics =&lt;BR /&gt;CALCULATETABLE (&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;Tournaments,&lt;BR /&gt;Tournaments[Player name],&lt;BR /&gt;Tournaments[Player type],&lt;BR /&gt;"Average Standing", [1. Average standing],&lt;BR /&gt;"Player Results Agg", [2. Player results agg],&lt;BR /&gt;"Sets Won - Sets Lost Agg", [3. Sets won - sets lost agg]&lt;BR /&gt;),&lt;BR /&gt;ALLSELECTED('List of tournaments'[Tournament type]),&lt;BR /&gt;ALLSELECTED('List of seasons'[Attendees]),&lt;BR /&gt;ALLSELECTED('List of seasons'[Season type]),&lt;BR /&gt;ALLSELECTED('List of seasons'[Season]),&lt;BR /&gt;ALLSELECTED('List of tournaments'[Date])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;SeasonalRanking =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;PlayerMetrics,&lt;BR /&gt;"1st Measure Rank", RANKX(ALL(PlayerMetrics), [Average Standing], , ASC),&lt;BR /&gt;"2nd Measure Rank", RANKX(ALL(PlayerMetrics), [Player Results Agg], , DESC),&lt;BR /&gt;"3rd Measure Rank", RANKX(ALL(PlayerMetrics), [Sets Won - Sets Lost Agg], , DESC),&lt;BR /&gt;"Proxy Score", 10000 * [1st Measure Rank] - 1000 * [2nd Measure Rank] - [3rd Measure Rank]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;FinalRanking =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;SeasonalRanking,&lt;BR /&gt;"Final Rank", RANKX(ALL(SeasonalRanking), [Proxy Score], , ASC)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;FinalRankingMain =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;FILTER(SeasonalRanking, SeasonalRanking[Player type] = "main player"),&lt;BR /&gt;"Final Rank Main", RANKX(FILTER(ALL(SeasonalRanking), SeasonalRanking[Player type] = "main player"), [Proxy Score], , ASC)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FinalRankingGuest =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;FILTER(SeasonalRanking, SeasonalRanking[Player type] = "guest"),&lt;BR /&gt;"Final Rank Guest", RANKX(FILTER(ALL(SeasonalRanking), SeasonalRanking[Player type] = "guest"), [Proxy Score], , ASC)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you might need to adjust. And you need to check a way to use Summarize with allselected. this should work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 11:17:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-ranking-based-on-3-columns/m-p/3340649#M125380</guid>
      <dc:creator>rubayatyasmin</dc:creator>
      <dc:date>2023-07-20T11:17:51Z</dc:date>
    </item>
  </channel>
</rss>

