<?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: Return value and sum the number of matching columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-value-and-sum-the-number-of-matching-columns/m-p/3815996#M149232</link>
    <description>&lt;P&gt;Surely one of these fields has to be a unique identifier for the asset?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; I didn’t want to do a merge in Power Query so I can keep the data sources separate.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would have been an append, not a merge.&amp;nbsp; Please elaborate on the reasoning.&lt;/P&gt;</description>
    <pubDate>Sat, 06 Apr 2024 20:06:53 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-04-06T20:06:53Z</dc:date>
    <item>
      <title>Return value and sum the number of matching columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-value-and-sum-the-number-of-matching-columns/m-p/3814374#M149185</link>
      <description>&lt;P&gt;We have multiple data sources that contain asset information in them. I created a correlation virtual table to combine two data source tables. I didn’t want to do a merge in Power Query so I can keep the data sources separate. The data in both data sources can contain multiple entries for each of the columns so building a relationship, using lookup values all result in errors. I used the following DAX code to combine the two tables into a virtual table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correlation =&lt;/P&gt;&lt;P&gt;DISTINCT(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;UNION(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SELECTCOLUMNS(Table1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Computer Name", Table1[ComputerName],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Property ID", Table1[PropertyID],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"MAC Address", Table1[MAC Address],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Service Tag", Table1[Service Tag]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SELECTCOLUMNS(Table2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Computer Name", Table2[ComputerName],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Property ID", Table2[PropertyID],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"MAC Address", Table2[MAC Address],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Service Tag", Table2[Service Tag])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ) &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to do is create new columns that capture the unique IDs from each of the tables (table 1 and table 2) and a confidence matching level for each of the tables. The steps I want to perform are as follows:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Check if the ComputerName from table1 is in the correlation table, if so, return 1&lt;/LI&gt;&lt;LI&gt;Check if the PropertyID from table 1 is in the correlation table, if so, return 1&lt;/LI&gt;&lt;LI&gt;Check if MAC Address from table 1 is in the correlation table, if so, return 1&lt;/LI&gt;&lt;LI&gt;Check if Service Tag from table 1 is in the correlation table, if so, return&lt;/LI&gt;&lt;LI&gt;Sum the return values for a confidence percentage. NOTE: I can return 25 in the steps above to add up to 100 if that is easier.&lt;OL&gt;&lt;LI&gt;4 = 100%&lt;/LI&gt;&lt;LI&gt;3 = 75%&lt;/LI&gt;&lt;LI&gt;2 = 50%&lt;/LI&gt;&lt;LI&gt;1= 25%&lt;/LI&gt;&lt;LI&gt;0=0%&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Return the Unique ID from table 1 depending on a 75% or more confidence level&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn’t matter how many columns are created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started with the following. As of now, it will only return&amp;nbsp; Table 1’s Unique ID if all 4 of the columns match. I need to do the same steps above for Table 2 so I can then show where they 100 % match each other, 75 % match, etc…This will help with data clean up. The goal is to get the unique ids from both table 1 and table 2 on the same row if the confidence rating is the same or higher.&lt;/P&gt;&lt;P&gt;Table1 ID = MAXX(FILTER(Table1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1[Computer Name]='Correlation'[Computer Name]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1[PropertyID]='Correlation'[Property ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1[MAC Address]=Correlation[MAC Address]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1[Service Tag]=Correlation[Service Tag]&lt;/P&gt;&lt;P&gt;), Table1[Unique ID])&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 19:22:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-value-and-sum-the-number-of-matching-columns/m-p/3814374#M149185</guid>
      <dc:creator>Neiners</dc:creator>
      <dc:date>2024-04-05T19:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Return value and sum the number of matching columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-value-and-sum-the-number-of-matching-columns/m-p/3815996#M149232</link>
      <description>&lt;P&gt;Surely one of these fields has to be a unique identifier for the asset?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; I didn’t want to do a merge in Power Query so I can keep the data sources separate.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would have been an append, not a merge.&amp;nbsp; Please elaborate on the reasoning.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 20:06:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-value-and-sum-the-number-of-matching-columns/m-p/3815996#M149232</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-06T20:06:53Z</dc:date>
    </item>
  </channel>
</rss>

