<?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 2 rows in a table based on a matching data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2534844#M71212</link>
    <description>&lt;P&gt;Hi Rico,&lt;BR /&gt;&lt;BR /&gt;Thank you. That was great help. I was able to apply this to my data which has a few thousand rows and multiple columns to compare.&amp;nbsp;&lt;BR /&gt;Is there a way for me to filter or export the "Fails' into another table or list?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Andy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 03:49:12 GMT</pubDate>
    <dc:creator>andy919</dc:creator>
    <dc:date>2022-05-24T03:49:12Z</dc:date>
    <item>
      <title>Comparing 2 rows in a table based on a matching data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2522220#M70387</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to compare 2 rows based on the value in column 1 which has a matching value in column 2 and vice versa. Column 3 tells me the number of the row for the matching pair. eg the first row shows "2" meaning the row 2 is the other pair for comparision.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would then like to compare the rows with the data in columns 4 and 5 based on the above criteria.&amp;nbsp;&lt;BR /&gt;Column 4 shows row 1 and 2 has different values so it should as a pass.&lt;/P&gt;&lt;P&gt;Column 5 shows a duplicate value so it should show as a fail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;1q1q&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;456&lt;/TD&gt;&lt;TD&gt;1q1q&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to help?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Andy&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 06:12:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2522220#M70387</guid>
      <dc:creator>andy919</dc:creator>
      <dc:date>2022-05-18T06:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 rows in a table based on a matching data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2532022#M71049</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="391023" data-lia-user-login="andy919" class="lia-mention lia-mention-user"&gt;andy919&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you table should look like as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then create a table with column name 4 and 5. We need it to create a slicer.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column Name = {"Column4","Column5"}&lt;/LI-CODE&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Compare = 
VAR _SELECTVALUE =
    SELECTEDVALUE ( 'Column Name'[Column Name] )
VAR _VALUE_COLUMN4 =
    CALCULATE (
        MAX ( 'Table'[Column4] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Compare Row ID] = MAX ( 'Table'[Row ID] ) )
    )
VAR _VALUE_COLUMN5 =
    CALCULATE (
        MAX ( 'Table'[Column5] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Compare Row ID] = MAX ( 'Table'[Row ID] ) )
    )
RETURN
    SWITCH (
        _SELECTVALUE,
        "Column4", IF ( MAX ( 'Table'[Column4] ) = _VALUE_COLUMN4, "Fail", "Pass" ),
        "Column5", IF ( MAX ( 'Table'[Column5] ) = _VALUE_COLUMN5, "Fail", "Pass" )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;Select Column4:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Select Column5:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 05:40:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2532022#M71049</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-23T05:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 rows in a table based on a matching data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2534844#M71212</link>
      <description>&lt;P&gt;Hi Rico,&lt;BR /&gt;&lt;BR /&gt;Thank you. That was great help. I was able to apply this to my data which has a few thousand rows and multiple columns to compare.&amp;nbsp;&lt;BR /&gt;Is there a way for me to filter or export the "Fails' into another table or list?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Andy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 03:49:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-2-rows-in-a-table-based-on-a-matching-data/m-p/2534844#M71212</guid>
      <dc:creator>andy919</dc:creator>
      <dc:date>2022-05-24T03:49:12Z</dc:date>
    </item>
  </channel>
</rss>

