<?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 NATURALINNERJOIN function doesn't work matching a text column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1808874#M38195</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;in a my pbi model I need to create a new table by DAX to match some columns of two tables created after more power query logics.&lt;/P&gt;&lt;P&gt;In order to accomplish a such task I've used the NATURALINNERJOIN function but unsuccessfully because I've obtained a cartesian product.&lt;/P&gt;&lt;P&gt;I've analyzed my data inside a bit test model and I've noticed that the issue is caused by the unmatching respect to a text column used in the join function. In particular, in the test model I've created manually two tables:&lt;/P&gt;&lt;P&gt;- Tab_A, with the text column named "Code" and an integer column named "obs_value",&lt;/P&gt;&lt;P&gt;- Tab_B,&amp;nbsp;with the text column named "Code" and an integer column named "exp_value".&lt;/P&gt;&lt;P&gt;I've filled the column "Code" of these two tables with a sample value, "aaaa", adding 2 rows for Tab_A and 3 rows for Tab_B.&lt;BR /&gt;No relationships exist between Tab_A and Tab_B.&lt;/P&gt;&lt;P&gt;To create the new dax table I've used this function:&lt;/P&gt;&lt;P&gt;TAB_B_A_JOIN =&lt;BR /&gt;NATURALINNERJOIN&lt;BR /&gt;( SELECTCOLUMNS(Tab_B,&lt;BR /&gt;"Code", Tab_B[Code]&amp;amp;"",&lt;BR /&gt;"Expected value", Tab_B[exp_value]+0 ),&lt;BR /&gt;SELECTCOLUMNS(Tab_A,&lt;BR /&gt;"Code", Tab_A[Code]&amp;amp;"",&lt;BR /&gt;"Observed value", Tab_A[obs_value]+0 )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;but it has returned 6 rows and not 2 ones.&lt;BR /&gt;With an integer column as a matching column, the above dax expression functions with success!&lt;/P&gt;&lt;P&gt;I think to use a whatever transformation to obtain a numeric value from the text column, but I don't know a such dax function.&lt;/P&gt;&lt;P&gt;Other suggests to me in order to solve this issue, please? Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 13:26:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-04-27T13:26:02Z</dc:date>
    <item>
      <title>NATURALINNERJOIN function doesn't work matching a text column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1808874#M38195</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;in a my pbi model I need to create a new table by DAX to match some columns of two tables created after more power query logics.&lt;/P&gt;&lt;P&gt;In order to accomplish a such task I've used the NATURALINNERJOIN function but unsuccessfully because I've obtained a cartesian product.&lt;/P&gt;&lt;P&gt;I've analyzed my data inside a bit test model and I've noticed that the issue is caused by the unmatching respect to a text column used in the join function. In particular, in the test model I've created manually two tables:&lt;/P&gt;&lt;P&gt;- Tab_A, with the text column named "Code" and an integer column named "obs_value",&lt;/P&gt;&lt;P&gt;- Tab_B,&amp;nbsp;with the text column named "Code" and an integer column named "exp_value".&lt;/P&gt;&lt;P&gt;I've filled the column "Code" of these two tables with a sample value, "aaaa", adding 2 rows for Tab_A and 3 rows for Tab_B.&lt;BR /&gt;No relationships exist between Tab_A and Tab_B.&lt;/P&gt;&lt;P&gt;To create the new dax table I've used this function:&lt;/P&gt;&lt;P&gt;TAB_B_A_JOIN =&lt;BR /&gt;NATURALINNERJOIN&lt;BR /&gt;( SELECTCOLUMNS(Tab_B,&lt;BR /&gt;"Code", Tab_B[Code]&amp;amp;"",&lt;BR /&gt;"Expected value", Tab_B[exp_value]+0 ),&lt;BR /&gt;SELECTCOLUMNS(Tab_A,&lt;BR /&gt;"Code", Tab_A[Code]&amp;amp;"",&lt;BR /&gt;"Observed value", Tab_A[obs_value]+0 )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;but it has returned 6 rows and not 2 ones.&lt;BR /&gt;With an integer column as a matching column, the above dax expression functions with success!&lt;/P&gt;&lt;P&gt;I think to use a whatever transformation to obtain a numeric value from the text column, but I don't know a such dax function.&lt;/P&gt;&lt;P&gt;Other suggests to me in order to solve this issue, please? Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 13:26:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1808874#M38195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-27T13:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: NATURALINNERJOIN function doesn't work matching a text column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1814394#M38370</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot replicate your results. Perhaps I don't have the correct data in Tab_A and Tab_B?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tab_A&lt;/P&gt;
&lt;P&gt;Codeobs_value&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;aaaa&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;bbbb&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tab_B&lt;/P&gt;
&lt;P&gt;Codeexp_value&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;aaaa&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;bbbb&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;cccc&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TAB_B_A_JOIN (copied your code directly from the post)&lt;/P&gt;
&lt;P&gt;CodeExpected valueObserved value&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;aaaa&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;bbbb&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is not the correct source data, please clarify.&amp;nbsp; Perhaps there are relationships you're not aware of that may be affecting your results?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 14:29:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1814394#M38370</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2021-04-29T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: NATURALINNERJOIN function doesn't work matching a text column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1814808#M38381</link>
      <description>&lt;P&gt;Hi, thanks for your reply.&lt;/P&gt;&lt;P&gt;I've discovered some errors in data for Tab_A and Tab_B, sorry.&lt;/P&gt;&lt;P&gt;It seems that the NATURALINNERJOIN functions rightly as you have indicated.&lt;/P&gt;&lt;P&gt;Many thanks and bye&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 16:42:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/NATURALINNERJOIN-function-doesn-t-work-matching-a-text-column/m-p/1814808#M38381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-29T16:42:24Z</dc:date>
    </item>
  </channel>
</rss>

