<?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: Search across two tables, for similair data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/895758#M8065</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;As your imported name doesn't have complete name so I'm matching first character of first name and last name. Please try below measure. Let me know if it works&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _imported = MAX(Imported[Name])
VAR _secondName = RIGHT(_imported,LEN(_imported)-SEARCH(" ",_imported,1,0))
RETURN CALCULATE(MAX(Portfolio[Code]),FILTER(Portfolio,SEARCH(LEFT(_imported,1),LEFT(Portfolio[Name],1),1,0)&amp;amp;&amp;amp;SEARCH(_secondName,Portfolio[Name],1,0)))&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 10 Jan 2020 04:40:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-10T04:40:04Z</dc:date>
    <item>
      <title>Search across two tables, for similair data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/895632#M8062</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying to repeat a DAX calculation discused by Pragmatic Works here &lt;STRONG&gt;&lt;FONT&gt;&lt;A href="https://youtu.be/eKgcLcrebzI" target="_blank" rel="noopener"&gt;https://youtu.be/eKgcLcrebzI&lt;/A&gt;&lt;/FONT&gt; &lt;/STRONG&gt;(&lt;EM&gt;44mins 41 sec for the actual full expression&lt;/EM&gt;).&amp;nbsp; This was to help deal with bad data basically.&amp;nbsp; So I have managed to get this to expression to work on another project with some success, but when I tried it for my new project all failed.&amp;nbsp; I think it could be to do with SEARCH is a scalar function and I am needing "row by row" context; &lt;EM&gt;please correct me if I am getting the evaluation &lt;SPAN&gt;context &lt;/SPAN&gt;aspect wrong&lt;/EM&gt;, and I need a &lt;STRONG&gt;filter&lt;/STRONG&gt; for Row Context..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this i my example -&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;&lt;STRONG&gt;Table 1&lt;/STRONG&gt;: My main reference table, this has the a full user names and cost centre codes.&amp;nbsp; My starting point.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table 2&lt;/STRONG&gt;: This is my imported data, excel report, there are a number of columns in this table but I am only looking at the one column called name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step1 Match:&lt;/STRONG&gt; So I am wanting search for the name from table one and see if exists in table two, if not then just a blank field.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step2Remove:&lt;/STRONG&gt; the final or outcome once I or DAX removes the blanks.&amp;nbsp; So the first column is what I imported, column two is the correct full name and its cost centre. &amp;nbsp;&lt;/P&gt;&lt;P&gt;My model has several other table, which are a one-to-many relationship. Would this be a factor as to why the expression is maybe not working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my attemp at the DAX expression:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;Match Name = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;calculate(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX('Portfolio1'[NAME]), &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT color="#0000ff"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; should there be a filter here??&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEARCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;SPAN&gt;'Portfolio1'[NAME]&lt;/SPAN&gt;, ImportedData[NAME],,0)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;)&amp;gt;0&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relationship with &lt;STRONG&gt;P&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;ortfolio1&lt;/STRONG&gt; to &lt;STRONG&gt;ImportedData&lt;/STRONG&gt;, is a ONE-TO-MANY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Chris Carpenter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 01:23:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/895632#M8062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-10T01:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Search across two tables, for similair data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/895758#M8065</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;As your imported name doesn't have complete name so I'm matching first character of first name and last name. Please try below measure. Let me know if it works&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _imported = MAX(Imported[Name])
VAR _secondName = RIGHT(_imported,LEN(_imported)-SEARCH(" ",_imported,1,0))
RETURN CALCULATE(MAX(Portfolio[Code]),FILTER(Portfolio,SEARCH(LEFT(_imported,1),LEFT(Portfolio[Name],1),1,0)&amp;amp;&amp;amp;SEARCH(_secondName,Portfolio[Name],1,0)))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jan 2020 04:40:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/895758#M8065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-10T04:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Search across two tables, for similair data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/897014#M8100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;vimal_parma&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats is looking very good :), this works fine when I have 'First Name' followed by 'Last Name', but if these are swapped around then I get a diffrenet result. For example if I change "M PLANT" to "PLANT M" the layout changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 18:00:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-across-two-tables-for-similair-data/m-p/897014#M8100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-11T18:00:36Z</dc:date>
    </item>
  </channel>
</rss>

