<?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: Scoring from 2 tables and Dickinson system in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019618#M102679</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="404599" data-lia-user-login="TomasAndersson" class="lia-mention lia-mention-user"&gt;TomasAndersson&lt;/a&gt;&amp;nbsp;Yes you are right, I have already corrected. There are always only two teams 0 and 1. Thank you very much for your help.&amp;nbsp;It seems to me that there is a mistake somewhere because comparing the value of Text with a number is impossible.&amp;nbsp;Still missing is the condition of averages for team 0 and 1 to be counted only for games with the same ID.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 15:13:51 GMT</pubDate>
    <dc:creator>Pan_Forex</dc:creator>
    <dc:date>2023-01-13T15:13:51Z</dc:date>
    <item>
      <title>Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019403#M102670</link>
      <description>&lt;P&gt;Hello guys,&amp;nbsp;I wonder if it is possible to create functions and tables that will work like this.&amp;nbsp;I currently have 3 tables. One with the players and their individual ratings. The other is with the games and the scores of the individual games.&amp;nbsp;The third table is the calendar.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;player&amp;nbsp; &amp;nbsp; &amp;n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p;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Player&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Score&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;5,5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;5,3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;I would like it to create a new column "Dickinson" in 1 table.&amp;nbsp; The Dickinson system awards 30 points for a victory over a strong team, and 20 for victory over a weak team. Defeats count half as much as victories 15 pts vs. strong team, 10 pts vs. weak team.&amp;nbsp;Whether a team is inferior is determined by the average of the team in the second table.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The result for the above example: Team 0 avg=5,83, Team 1 avg=5,76&amp;nbsp; &amp;nbsp;Team 1 &amp;lt; Team 0&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;player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.2023&lt;/TD&gt;&lt;TD&gt;90000&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;TRUE&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 13 Jan 2023 15:05:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019403#M102670</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2023-01-13T15:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019531#M102673</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;I'm not completely sure of your questions. I don't get 5.6 and 6 as averages for team 0 and 1 when I look at your table and am not sure if there can be more than two teams and how the data looks in that case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example code that should work in the example you gave, maybe it can help you on the way a bit:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dicksinon = 
VAR __ThisTeamRating = 
CALCULATE(average(Players[Score]),
    RELATED(Players[Player]) = Results[player])

VAR __OpponentTeamRating = 
CALCULATE(average(Players[Score]),
    RELATED(Players[Player]) &amp;lt;&amp;gt; Results[player])

VAR __OpponentStrength =
 if(__OpponentTeamRating &amp;gt;= __ThisTeamRating,
 "Strong",
 "Weak")

VAR __ScoreAwarded = 
IF(__OpponentStrength = "Strong",30,20)

return 
if(Results[won] = "TRUE", __ScoreAwarded, __ScoreAwarded / 2)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 13 Jan 2023 14:36:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019531#M102673</guid>
      <dc:creator>TomasAndersson</dc:creator>
      <dc:date>2023-01-13T14:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019618#M102679</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="404599" data-lia-user-login="TomasAndersson" class="lia-mention lia-mention-user"&gt;TomasAndersson&lt;/a&gt;&amp;nbsp;Yes you are right, I have already corrected. There are always only two teams 0 and 1. Thank you very much for your help.&amp;nbsp;It seems to me that there is a mistake somewhere because comparing the value of Text with a number is impossible.&amp;nbsp;Still missing is the condition of averages for team 0 and 1 to be counted only for games with the same ID.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 15:13:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019618#M102679</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2023-01-13T15:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019718#M102686</link>
      <description>&lt;P&gt;I missed to add a condition so that only the team's average score is only calculated from players that belong to that team. I also added a similar to only look at players that were in the current game as well.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dicksinon = 
VAR __ThisTeamRating = 
CALCULATE(average(Players[Score]),
    RELATED(Players[Player]) = Results[player],
    Results[team] = EARLIER(Results[team]),
    Results[id] = EARLIER(Results[id])
)

VAR __OpponentTeamRating = 
CALCULATE(average(Players[Score]),
    RELATED(Players[Player]) &amp;lt;&amp;gt; Results[player],
    Results[team] = EARLIER(Results[team]),
    Results[id] = EARLIER(Results[id])
)

VAR __OpponentStrength =
 if(__OpponentTeamRating &amp;gt;= __ThisTeamRating,
 "Strong",
 "Weak")

VAR __ScoreAwarded = 
IF(__OpponentStrength = "Strong",30,20)

return 
if(Results[won] = "TRUE", __ScoreAwarded, __ScoreAwarded / 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When it comes to the Text/Value error, let me know where that error occurs. This works with the data I'm using so it's probably a data type of some column that's different for you and me.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 15:45:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019718#M102686</guid>
      <dc:creator>TomasAndersson</dc:creator>
      <dc:date>2023-01-13T15:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019890#M102695</link>
      <description>&lt;P&gt;Thank you so much for your time and work!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 16:57:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3019890#M102695</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2023-01-13T16:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3020797#M102761</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="404599" data-lia-user-login="TomasAndersson" class="lia-mention lia-mention-user"&gt;TomasAndersson&lt;/a&gt;&amp;nbsp;Hello, currently the function returns only the values 30 and 15.&amp;nbsp;It should still return 20 and 10.&amp;nbsp;If the inferior team won then 30 points for the winner and 10 for the loser. If the better team won then 20 points for the winner and 15 for the loser. I tried to add conditions to the if function and unfortunately it does not work.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2023 14:18:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3020797#M102761</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2023-01-14T14:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from 2 tables and Dickinson system</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3021514#M102833</link>
      <description>&lt;P&gt;Hi, I think I did something wrong with calculating the team average score. It didn't calculate the average for the team as a whole, only for individual players.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dicksinon = 
VAR __ThisTeamRating = 
CALCULATE(AVERAGEX(Results,RELATED(Players[Score])),
    FILTER(ALL(Results),
    Results[team] = EARLIER(Results[team]) &amp;amp;&amp;amp;
    Results[id] = EARLIER(Results[id])
   )
)

VAR __OpponentTeamRating = 
CALCULATE(AVERAGEX(Results,RELATED(Players[Score])),
    FILTER(ALL(Results),
    Results[team] &amp;lt;&amp;gt; EARLIER(Results[team]) &amp;amp;&amp;amp;
    Results[id] = EARLIER(Results[id])
   )
)

VAR __OpponentStrength =
 if(__OpponentTeamRating &amp;gt;= __ThisTeamRating,
 "Strong",
 "Weak")

VAR __ScoreAwarded = 
IF(__OpponentStrength = "Strong",30,20)

return 
if(Results[won] = "TRUE", __ScoreAwarded, __ScoreAwarded / 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it seems to return either 30 and 10 or 20 and 15:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 16:13:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Scoring-from-2-tables-and-Dickinson-system/m-p/3021514#M102833</guid>
      <dc:creator>TomasAndersson</dc:creator>
      <dc:date>2023-01-15T16:13:49Z</dc:date>
    </item>
  </channel>
</rss>

