<?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 Matchtable in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/795501#M4672</link>
    <description>&lt;P&gt;I have a match table with 2 teams, a home team and a visiting team. The score for each team is also in the table.&lt;BR /&gt;What I would like to do is, that I can be able to filter (page filter) a visual table with all matches where a specified (chosen team) is eather home team or visiting team. I would also like to calculate, if the filtered team is the winner og looser, or if the match ended equal.&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2019 08:55:06 GMT</pubDate>
    <dc:creator>bfj4800</dc:creator>
    <dc:date>2019-09-18T08:55:06Z</dc:date>
    <item>
      <title>Matchtable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/795501#M4672</link>
      <description>&lt;P&gt;I have a match table with 2 teams, a home team and a visiting team. The score for each team is also in the table.&lt;BR /&gt;What I would like to do is, that I can be able to filter (page filter) a visual table with all matches where a specified (chosen team) is eather home team or visiting team. I would also like to calculate, if the filtered team is the winner og looser, or if the match ended equal.&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 08:55:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/795501#M4672</guid>
      <dc:creator>bfj4800</dc:creator>
      <dc:date>2019-09-18T08:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Matchtable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/796174#M4690</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="53888" data-lia-user-login="bfj4800" class="lia-mention lia-mention-user"&gt;bfj4800&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im not sure how exactly do you want to calculate winner/looser/draw&lt;/P&gt;&lt;P&gt;So, i have a solution, maybe not the best, but..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first, i added index column to original table:&lt;/P&gt;&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIEYmcgNlCK1YkGs4yBGCRjBBZxArMgagzBIiA5E6iIiVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Home = _t, HomeScores = _t, Visitors = _t, VisitorScores = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Home", type text}, {"HomeScores", Int64.Type}, {"Visitors", type text}, {"VisitorScores", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1)
in
    #"Added Index"&lt;/PRE&gt;&lt;P&gt;then i dublicated it twice:&lt;/P&gt;&lt;P&gt;i created table with index and team in match columns&lt;/P&gt;&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIEYmcgNlCK1YkGs4yBGCRjBBZxArMgagzBIiA5E6iIiVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Home = _t, HomeScores = _t, Visitors = _t, VisitorScores = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Home", type text}, {"HomeScores", Int64.Type}, {"Visitors", type text}, {"VisitorScores", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Index",{"Visitors", "Home", "Index"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Other Columns", {"Index"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Value", "Team"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Attribute"})
in
    #"Removed Columns"&lt;/PRE&gt;&lt;P&gt;and i created table with index match, team name and calculated team result:&lt;/P&gt;&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIEYmcgNlCK1YkGs4yBGCRjBBZxArMgagzBIiA5E6iIiVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Home = _t, HomeScores = _t, Visitors = _t, VisitorScores = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Home", type text}, {"HomeScores", Int64.Type}, {"Visitors", type text}, {"VisitorScores", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
    #"Added Custom" = Table.AddColumn(#"Added Index", "HomeResult", each if [HomeScores]&amp;gt;[VisitorScores] then 
Text.Combine({[Home],"|","W"})
else if [HomeScores]=[VisitorScores] then
Text.Combine({[Home],"|","D"})
else Text.Combine({[Home],"|","L"})),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "VisitorResult", each if [HomeScores]&amp;gt;[VisitorScores] then 
Text.Combine({[Visitors],"|","L"})
else if [HomeScores]=[VisitorScores] then
Text.Combine({[Visitors],"|","D"})
else Text.Combine({[Visitors],"|","W"})),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Home", "HomeScores", "Visitors", "VisitorScores"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Index"}, "Attribute", "Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Removed Columns1", "Value", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"Value.1", "Value.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Value.1", type text}, {"Value.2", type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Value.1", "Team"}, {"Value.2", "Result"}})
in
    #"Renamed Columns"&lt;/PRE&gt;&lt;P&gt;next i created calculated table in dax&lt;/P&gt;&lt;PRE&gt;teamList = DISTINCT(matchTeams[Team])&lt;/PRE&gt;&lt;P&gt;next i setted up relashionships&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and create visuals&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;A title="pbix file" href="https://ufile.io/6c0p6vk0" target="_blank" rel="noopener"&gt;See attach&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 19:43:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/796174#M4690</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-09-18T19:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Matchtable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/796186#M4692</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="53888" data-lia-user-login="bfj4800" class="lia-mention lia-mention-user"&gt;bfj4800&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My long long reply didn't saved (((&lt;/P&gt;&lt;P&gt;so, try pbix file&amp;nbsp;&lt;A title="pbix" href="https://ufile.io/6c0p6vk0" target="_blank" rel="noopener"&gt;in attach&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 19:46:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matchtable/m-p/796186#M4692</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-09-18T19:46:43Z</dc:date>
    </item>
  </channel>
</rss>

