<?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 to find highest matching column value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648663#M78025</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Here is a proposed solution&amp;nbsp;&lt;A href="https://we.tl/t-RvZP2J3nLr" target="_blank"&gt;https://we.tl/t-RvZP2J3nLr&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Matching = 
VAR PlannedClients = VALUES ( Planned[Client] )
RETURN
    MAXX ( 
        SUMMARIZE ( Executed, Executed[Route Letter] ),
        VAR ExecutedClients = CALCULATETABLE ( VALUES ( Executed[Client] ) )
        VAR CommonClients = INTERSECT ( PlannedClients, ExecutedClients )
        RETURN
            DIVIDE ( 
                COUNTROWS ( CommonClients ),
                COUNTROWS ( PlannedClients )
            )
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 19 Jul 2022 20:15:03 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-07-19T20:15:03Z</dc:date>
    <item>
      <title>DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648504#M78000</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables, one containing "Planned Routes" and other containing "Executed Routes". Problem is I don't have a persistent value in both columns to create a relationship.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I want to match the ID from the first table to a different ID on the second table (represented as "Letter"), by finding the highest matching client list from both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example below, Route ID "1" equals Route Letter "A", because the match is 100%. But sometimes, some clients won't be delivered (location is closed), so it won't match perfectly. In this case, it should find the highest match possible and display its correspondent ID/Letter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;EDIT: The steps (for route ID 1):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compare Route ID 1 to Route Letter A and get its matching value (100%)&lt;/P&gt;&lt;P&gt;Compare Route ID 1 to Route Letter B and get its matching value (0%)&lt;/P&gt;&lt;P&gt;Compare Route ID 1 to Route Letter C and get its matching value (0%)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Evaluate the maximum value between them (100%) and return the correspondent Letter ("A").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The numbers won't always be 0 and 100%, because that might be planned routes that share the same customer and routes that won't be able to deliver all customers. I just need to know the highest matching among all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 20:07:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648504#M78000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-19T20:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648557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SPAN&gt;REMOVEFILTERS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TableNew[Rount Letter]&lt;/SPAN&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;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Jul 2022 19:22:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648557#M78008</guid>
      <dc:creator>vapid128</dc:creator>
      <dc:date>2022-07-19T19:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648584#M78018</link>
      <description>&lt;P&gt;Problem is that a client can be present in multiple Routes (differing by day to day).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the group of all clients from a planned route being comparable to an executed route that lets me find the correct match&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 19:36:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648584#M78018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-19T19:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648663#M78025</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Here is a proposed solution&amp;nbsp;&lt;A href="https://we.tl/t-RvZP2J3nLr" target="_blank"&gt;https://we.tl/t-RvZP2J3nLr&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Matching = 
VAR PlannedClients = VALUES ( Planned[Client] )
RETURN
    MAXX ( 
        SUMMARIZE ( Executed, Executed[Route Letter] ),
        VAR ExecutedClients = CALCULATETABLE ( VALUES ( Executed[Client] ) )
        VAR CommonClients = INTERSECT ( PlannedClients, ExecutedClients )
        RETURN
            DIVIDE ( 
                COUNTROWS ( CommonClients ),
                COUNTROWS ( PlannedClients )
            )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Jul 2022 20:15:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648663#M78025</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-19T20:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648678#M78028</link>
      <description>&lt;P&gt;This is simply AMAZING! My mind is twisting and turning around this solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're incredible!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 20:30:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648678#M78028</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-19T20:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648693#M78030</link>
      <description>&lt;P&gt;Is there a way to bring the "Route Letter" in this case as a column in the planned table? So I can build the relationship around it and make other calculations&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 20:37:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648693#M78030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-19T20:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to find highest matching column value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648711#M78031</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It may be possible but I'm afraid that this will result in a circular dependency error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 20:49:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-find-highest-matching-column-value/m-p/2648711#M78031</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-19T20:49:28Z</dc:date>
    </item>
  </channel>
</rss>

