<?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: Connecting 2 Tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2843451#M90897</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456818" data-lia-user-login="Asking" class="lia-mention lia-mention-user"&gt;Asking&lt;/a&gt; , You need a measure in this case &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure&amp;nbsp; =&lt;/P&gt;
&lt;P&gt;var _tab = values(Table2[ID])&lt;/P&gt;
&lt;P&gt;var _cnt= countx(filter(Table1, Table1[ID] in _tab), Table1[ID])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;if(isblank(_tab) , "N" else "Y")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or add new column in table 1 and join two tables and try filter&lt;/P&gt;
&lt;P&gt;New column =&lt;/P&gt;
&lt;P&gt;var _cnt = countx(filter(Table2, Table[ID] = Table1[ID]), Table2[ID])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;if(Isblank(_cnt) , "N", "Y")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Oct 2022 02:06:59 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-10-15T02:06:59Z</dc:date>
    <item>
      <title>Connecting 2 Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2842928#M90859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 1 table with ID # column which are not unique. I have another table with names and ID# which are not unique. I want to add a column to table 1 with a flag showing if the ID exists in table 2. The challege is that I wish to filter both tables in the dashboard. Meaning:&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2&lt;/P&gt;&lt;P&gt;1 j&lt;/P&gt;&lt;P&gt;1 k&lt;/P&gt;&lt;P&gt;2 h&lt;/P&gt;&lt;P&gt;4 j&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;1 Y&lt;/P&gt;&lt;P&gt;1 Y&lt;/P&gt;&lt;P&gt;2 Y&lt;/P&gt;&lt;P&gt;3 N&lt;/P&gt;&lt;P&gt;3 N&lt;/P&gt;&lt;P&gt;4 Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if I use the slicer in the dashboard and choose only j or k or both from table 2 and only ID # 1 and 2 from Table 1, the result should be:&lt;/P&gt;&lt;P&gt;1 Y&lt;/P&gt;&lt;P&gt;1 Y&lt;/P&gt;&lt;P&gt;2 N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I am explaining myself correctly.&lt;/P&gt;&lt;P&gt;Appreciate any help&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:34:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2842928#M90859</guid>
      <dc:creator>Asking</dc:creator>
      <dc:date>2022-10-14T15:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting 2 Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2843451#M90897</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456818" data-lia-user-login="Asking" class="lia-mention lia-mention-user"&gt;Asking&lt;/a&gt; , You need a measure in this case &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure&amp;nbsp; =&lt;/P&gt;
&lt;P&gt;var _tab = values(Table2[ID])&lt;/P&gt;
&lt;P&gt;var _cnt= countx(filter(Table1, Table1[ID] in _tab), Table1[ID])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;if(isblank(_tab) , "N" else "Y")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or add new column in table 1 and join two tables and try filter&lt;/P&gt;
&lt;P&gt;New column =&lt;/P&gt;
&lt;P&gt;var _cnt = countx(filter(Table2, Table[ID] = Table1[ID]), Table2[ID])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;if(Isblank(_cnt) , "N", "Y")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 02:06:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2843451#M90897</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-10-15T02:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting 2 Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2845366#M91045</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456818" data-lia-user-login="Asking" class="lia-mention lia-mention-user"&gt;Asking&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your needs, the values change dynamically according to the slicer, and the calculation cannot be dynamically calculated in the visual, so we need to use the new measure to achieve your needs.&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;BR /&gt;(1)To automatically deduplicate the Table and Matrix visuals, we need to create a new Index column in Table1:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We need to create a measure :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _id = VALUES(Table1[ID])
var _t_count =COUNTROWS( FILTER( 'Table2' ,  'Table2'[ID] in _id))
return 
IF( _t_count =BLANK() ,"N", "Y")&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we put the filed in the visual , and we will meet your need :&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(4)We can also close the "Column headers-Text wrap" to hide the 'index' column:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 02:38:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Connecting-2-Tables/m-p/2845366#M91045</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-10-17T02:38:01Z</dc:date>
    </item>
  </channel>
</rss>

