<?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: DAX Comparison between tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2620386#M76286</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty sure this is what I needed. Thank you so much for this! I really appreciate your effort in helping me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2022 16:01:38 GMT</pubDate>
    <dc:creator>Matas</dc:creator>
    <dc:date>2022-07-05T16:01:38Z</dc:date>
    <item>
      <title>DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2604024#M75355</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having an issue and cannot figure it out, since I am still pretty new on DAX. Currently, I am having a table in the database, where it stores the "Extracted" documents that have been automatically extracted value by the software. I also have the second step, during this process, called Validation - "VA02", the value can be manually changed or leave it as it came from "EX02".&lt;/P&gt;&lt;P&gt;I need to create a DAX measure that would return the distinct count of Document ID for the count of CALL_POINT = "VA02" that Values differ from the CALL_POINT = "EX02".&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The first row of EX02 corresponds with the first row of VA02, etc. There is a difference in lines 2 and 5, which means the value was changed manually. So the expected result, in this case, should be 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this example, the output should be 2. Since the value between EX02 and VA02 differs in DOCID 654476 and 654477.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 11:56:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2604024#M75355</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-06-27T11:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2604753#M75378</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327850" data-lia-user-login="Matas" class="lia-mention lia-mention-user"&gt;Matas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Here is a sample file with the solution&amp;nbsp;&lt;A href="https://we.tl/t-36zvTh2N5O" target="_blank"&gt;https://we.tl/t-36zvTh2N5O&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Doc. Count = 
VAR EXTable = 
    FILTER ( Extracted, [CALL_POINT] = "EX02" )
VAR VATable = 
    FILTER ( Extracted, [CALL_POINT] = "VA02" )
VAR T1 =
    ADDCOLUMNS ( EXTable, "@Rank", RANKX ( EXTable, [Index],, ASC, Dense ) )
VAR T2 = 
    ADDCOLUMNS ( 
        T1, 
        "@Value", 
        VAR CurrentRank = [@Rank]
        VAR T3 = TOPN ( CurrentRank, VATable, [Index], ASC )
        RETURN
            MAXX ( T3, [VALUE] )
    )
VAR T4 = 
    FILTER ( T2, [VALUE] &amp;lt;&amp;gt; [@Value] )
RETURN
    COUNTROWS ( T4 )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 27 Jun 2022 16:42:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2604753#M75378</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-27T16:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2605186#M75403</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply, I really appreciate it. Could I ask how could I optimize this code to Distinct DOCID? Since I do not have an Index in my tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 22:18:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2605186#M75403</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-06-27T22:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2605402#M75416</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327850" data-lia-user-login="Matas" class="lia-mention lia-mention-user"&gt;Matas&lt;/a&gt;&lt;/P&gt;&lt;P&gt;index column must be added using power query. I don't believe this problem can be solved o&lt;SPAN&gt;therwise.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 02:17:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2605402#M75416</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-28T02:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615305#M75987</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply. I have added the Index column, but the output returns not DISTINCT Docid result. How could I optimize your code, so that it would return only DISTINCT DOCID RowCount?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 15:06:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615305#M75987</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-07-02T15:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615316#M75990</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327850" data-lia-user-login="Matas" class="lia-mention lia-mention-user"&gt;Matas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please share a screenshot of your visual?&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 15:49:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615316#M75990</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-02T15:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615342#M75996</link>
      <description>&lt;P&gt;Sure&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My visual consists of 3 measures - Blanks, Extracted and Validated. This measure that we are trying to achieve is for Validation. Please check below the visual with the Doc Count, this is the issue. Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;Extracted for Amount - 695 out of 715 documents.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Blanks for Amount - 715 out of 715 Documents&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Validated for Amount - 2815 out of 715 documents.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 16:23:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615342#M75996</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-07-02T16:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615346#M75997</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327850" data-lia-user-login="Matas" class="lia-mention lia-mention-user"&gt;Matas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will solve your problem&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Doc. Count =
VAR EXTable =
    FILTER ( Extracted, [CALL_POINT] = "EX02" )
VAR VATable =
    FILTER ( Extracted, [CALL_POINT] = "VA02" )
VAR T1 =
    ADDCOLUMNS ( EXTable, "@Rank", RANKX ( EXTable, [Index],, ASC, DENSE ) )
VAR T2 =
    ADDCOLUMNS (
        T1,
        "@Value",
            VAR CurrentRank = [@Rank]
            VAR T3 =
                TOPN ( CurrentRank, VATable, [Index], ASC )
            RETURN
                MAXX ( T3, [VALUE] )
    )
VAR T4 =
    FILTER ( T2, [VALUE] &amp;lt;&amp;gt; [@Value] )
VAR T5 =
    SELECTCOLUMNS ( T4, "@ID", [DOCID] )
RETURN
    COUNTROWS ( DISTINCT ( T4 ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 02 Jul 2022 16:53:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615346#M75997</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-02T16:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615348#M75998</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply. Unfortunately I am getting exactly the same result by applying your new formula:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am adding my formula for "Extracted" measure, maybe this will help out:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;OCR Extracted Ratio = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var T1 = VALUES(Table[DOCID])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var T2 = ADDCOLUMNS(T1, "@NumOfBlanks", SUMX(FILTER(CALCULATETABLE(Table), Table[CALL_POINT] = "EX02"),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF (Table[VALUE] &amp;lt;&amp;gt; BLANK(),1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var T3 = FILTER(T2, [@NumOfBlanks] &amp;lt;&amp;gt; BLANK())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS(T3)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any idea of how to optimize your previous measure, I would be grateful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 17:05:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615348#M75998</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-07-02T17:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615350#M75999</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327850" data-lia-user-login="Matas" class="lia-mention lia-mention-user"&gt;Matas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it me who wrote that measure? It ssems that O don't fully understand your requirement for the validation measure. I prefer to connect via teams or zoom perhaps on Monday. It is really difficult in some cases to auther codes without having your hands on the real data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 17:16:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615350#M75999</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-02T17:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615358#M76000</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it was you who helped me with this measure as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sounds great, how could we connect via teams? Could you send me a private message?&lt;/P&gt;&lt;P&gt;And sorry that I cannot publish pbix file or show the full data behind it. This is data from the client, so I am not allowed to do so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 17:23:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2615358#M76000</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-07-02T17:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2620140#M76276</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327850" data-lia-user-login="Matas" class="lia-mention lia-mention-user"&gt;Matas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Pleas etry this code&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Document Count = 
SUMX (
    SUMMARIZE ( 'Raw Data','Raw Data'[REGID], 'Raw Data'[DOCID] ),
    CALCULATE (
        VAR EXTable = 
            FILTER ( 'Raw Data', [CALL_POINT] = "EX02" )
        VAR VATable = 
            FILTER ( 'Raw Data', [CALL_POINT] = "VA02" )
        VAR T1 =
            ADDCOLUMNS ( EXTable, "@Rank", RANKX ( EXTable, [Index],, ASC, Dense ) )
        VAR T2 = 
            ADDCOLUMNS ( 
                T1, 
                "@Value", 
                VAR CurrentRank = [@Rank]
                VAR T3 = TOPN ( CurrentRank, VATable, [Index], ASC )
                RETURN
                    MAXX ( T3, [VALUE] )
            )
        VAR T4 = 
            FILTER ( T2, [VALUE] &amp;lt;&amp;gt; [@Value] )
        VAR T5 = SELECTCOLUMNS ( T4, "@DOCID", [DOCID] )
        RETURN
            COUNTROWS ( DISTINCT ( T5 ) )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 Jul 2022 14:25:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2620140#M76276</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-05T14:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Comparison between tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2620386#M76286</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty sure this is what I needed. Thank you so much for this! I really appreciate your effort in helping me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matas&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 16:01:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Comparison-between-tables/m-p/2620386#M76286</guid>
      <dc:creator>Matas</dc:creator>
      <dc:date>2022-07-05T16:01:38Z</dc:date>
    </item>
  </channel>
</rss>

