<?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: Sum and Countif Matrix in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1737588#M36071</link>
    <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1y9NFJtMHJDSZUIqZFe2urVR71gUo8LZ0/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1y9NFJtMHJDSZUIqZFe2urVR71gUo8LZ0/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here you are. This is a solution with viewer rows. The rows of T1 and T2 are converted to lists contaning all the (column) values. Next I have made a query with a Cartesian of the row indexes of the rows (= lists) of T1 and T2. With a List.Intersect and a List.Count the numer of matches are determined.&lt;/P&gt;&lt;P&gt;The last step in Power query is to build a table with the match counts.&lt;/P&gt;&lt;P&gt;Finally the matrix is constructed in DAX.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;//JW&lt;/P&gt;</description>
    <pubDate>Mon, 22 Mar 2021 19:13:13 GMT</pubDate>
    <dc:creator>JW_van_Holst</dc:creator>
    <dc:date>2021-03-22T19:13:13Z</dc:date>
    <item>
      <title>Sum and Countif Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1732902#M35938</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Hi! &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;The first action I have in my table, is to check the number of values in Table 1 - Line 1 are equal within the Table 2, I am using the formula =SUM (COUNTIF (B12:P12; B3:P3)), as it is in the link "Image 1" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;&lt;A href="https://ibb.co/3yz3j0h" target="_self"&gt;Image 1&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;After this process, I need to count how many times we had 11, 12, 13, 14 and 15 equal values, for this process I use the formula =COUNTIF (R12: R25;"=11") in a new column in Table 1 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;&lt;A href="https://ibb.co/9sxPp8M" target="_self"&gt;Image 2&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;In summary, I need to individually check the rows/cells of table 1 in table 2 and count the number of times the result is 11, 12, 13, 14 and 15, with the final result, 5 additional columns in table 1 with these values comparing&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;against all the rows in table 2.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;&lt;A href="https://ibb.co/JycqXkR" target="_self"&gt;Image 3 - Final Table&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Can you help me on how to do this on PowerBI?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 13:01:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1732902#M35938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-19T13:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and Countif Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1733365#M35955</link>
      <description>&lt;P&gt;see the Pbix in the link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/16NMktbIBeRWYyCcYaWBr6SKtYfKdH5gi/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/16NMktbIBeRWYyCcYaWBr6SKtYfKdH5gi/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here is the outline of the solution:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Unpivot Table1 and Table2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Per table construct 3 columns Line/Column/Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cartersian product between T2 and {1..5}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Merge Cartesian with T1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Look where values are equal (then 1 else 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Groupby line T2 and Catesian with T1 and aggregate SUM equals ( 0 or 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Caterian Groupby with {11..15}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Compare Groupby with {11..15}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Power query steps are ready. Apply model to Power BI and construct the matrix…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;… and Bob’s your uncle!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;JW van Holst&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:31:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1733365#M35955</guid>
      <dc:creator>JW_van_Holst</dc:creator>
      <dc:date>2021-03-19T16:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and Countif Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1734766#M36003</link>
      <description>&lt;P&gt;Heelo&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284183" data-lia-user-login="JW_van_Holst" class="lia-mention lia-mention-user"&gt;JW_van_Holst&lt;/a&gt;.&lt;BR /&gt;First of all, thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, my tables are very large and these actions are not being completed via PowerQuery, I have 3,268,760 rows in table 1 and 2186 rows in table 2, which keeps growing every day (only table 2).&lt;/P&gt;&lt;P&gt;I would like to know if there is any simpler way of obtaining this result, on a small sample base in Excel, which I would carry out, as in the attachment, but I can't import and work my complete base in excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://filebin.net/fbdd16i1qnel48ih" target="_self"&gt;File Example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 12:55:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1734766#M36003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-21T12:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and Countif Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1737588#M36071</link>
      <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1y9NFJtMHJDSZUIqZFe2urVR71gUo8LZ0/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1y9NFJtMHJDSZUIqZFe2urVR71gUo8LZ0/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here you are. This is a solution with viewer rows. The rows of T1 and T2 are converted to lists contaning all the (column) values. Next I have made a query with a Cartesian of the row indexes of the rows (= lists) of T1 and T2. With a List.Intersect and a List.Count the numer of matches are determined.&lt;/P&gt;&lt;P&gt;The last step in Power query is to build a table with the match counts.&lt;/P&gt;&lt;P&gt;Finally the matrix is constructed in DAX.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;//JW&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 19:13:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-and-Countif-Matrix/m-p/1737588#M36071</guid>
      <dc:creator>JW_van_Holst</dc:creator>
      <dc:date>2021-03-22T19:13:13Z</dc:date>
    </item>
  </channel>
</rss>

