<?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: Comparing a category with the next ranked category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2497693#M68959</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;You need create a measure to count the average category by [Team ID] .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ave = CALCULATE( AVERAGE('Table'[YoYo Score]), ALLEXCEPT('Table','Table'[Team ID]))&lt;/LI-CODE&gt;
&lt;P&gt;Then create a measure to count the difference of score between selected player and the average score of team id +1 .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Score Difference = SUM('Table'[YoYo Score]) - CALCULATE([Ave], FILTER(ALL('Table'), 'Table'[Team ID] = MAX('Table'[Team ID]) + 1))&lt;/LI-CODE&gt;
&lt;P&gt;Add a slicer with column [Player ID] .The fianl result is as shown below .&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I have attached my pbix file , you can refer to it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 06 May 2022 06:13:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-06T06:13:39Z</dc:date>
    <item>
      <title>Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490572#M68559</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Aim:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;To compare results of a player in one age group to the next age group up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially, say I select player 001, &lt;U&gt;I want to find out what the difference is between their score and the average of the players in the age group above them.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Data:&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Player ID&lt;/TD&gt;&lt;TD&gt;Team ID&lt;/TD&gt;&lt;TD&gt;Session Date&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;YoYo Score&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;01/04/2022&lt;/TD&gt;&lt;TD&gt;1,480&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;002&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;01/04/2022&lt;/TD&gt;&lt;TD&gt;1,880&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;003&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;01/04/2022&lt;/TD&gt;&lt;TD&gt;1,750&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;004&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;01/04/2022&lt;/TD&gt;&lt;TD&gt;1,500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have thought about using RANKX but can't seem to get my head around it with something like IF TeamID is +1 of the SELECTEDVALUE then find difference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally I would like to achieve this in a measure, rather than creating a calculated table with it all in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 09:54:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490572#M68559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-03T09:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490582#M68560</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please provide more details. Where is age group you've mentioned in your query? What is the average? The ranking is based on what?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 10:00:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490582#M68560</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-03T10:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490599#M68561</link>
      <description>&lt;P&gt;The age group would be the TeamID. The average would be calculated in the measure I assume in a variable? In this instance if I were comparing player 001 then I would find the average of players in Team ID 4, as it's the next age group up, and then compare the results to that.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hope this helps?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 10:09:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490599#M68561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-03T10:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490621#M68563</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Score Difference =
VAR CurrentTeam =
    SELECTEDVALUE ( Table[Team ID] )
VAR CurrencyScore =
    SELECTEDVALUE ( Table[YOYO Score] )
VAR NextGroupAverage =
    CALCULATE (
        AVERAGE ( Table[YOYO Score] ),
        ALLEXCEPT ( Table, Table[Session Date] ),
        Table[Team ID] = CurrentTeam + 1
    )
RETURN
    CurrencyScore - NextGroupAverage&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 May 2022 10:26:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2490621#M68563</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-03T10:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2497693#M68959</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;You need create a measure to count the average category by [Team ID] .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ave = CALCULATE( AVERAGE('Table'[YoYo Score]), ALLEXCEPT('Table','Table'[Team ID]))&lt;/LI-CODE&gt;
&lt;P&gt;Then create a measure to count the difference of score between selected player and the average score of team id +1 .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Score Difference = SUM('Table'[YoYo Score]) - CALCULATE([Ave], FILTER(ALL('Table'), 'Table'[Team ID] = MAX('Table'[Team ID]) + 1))&lt;/LI-CODE&gt;
&lt;P&gt;Add a slicer with column [Player ID] .The fianl result is as shown below .&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I have attached my pbix file , you can refer to it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 06:13:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2497693#M68959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-06T06:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2501717#M69166</link>
      <description>&lt;P&gt;Thank you for your solution, I played around with it and split up the data into seperate tables and came out with the following which works:&amp;nbsp;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AN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;Summary[TeamCompOrder]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;AgeUp&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;Summary[Position]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SelectedPosition&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SelectedPlayerScore&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;AvgPositionUp&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 10:20:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2501717#M69166</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-09T10:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a category with the next ranked category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2503388#M69263</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 02:57:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-a-category-with-the-next-ranked-category/m-p/2503388#M69263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-10T02:57:50Z</dc:date>
    </item>
  </channel>
</rss>

