<?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: Left outer join on many-many relationship in Direct query Model in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4062051#M54357</link>
    <description>&lt;P&gt;Here is the matrix visual setup. Both the columns in this visual are from the tbl1. Hope this helps. Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data_model_0-1721929802852.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1139082i6404D52B8B093CD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="data_model_0-1721929802852.png" alt="data_model_0-1721929802852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2024 17:51:21 GMT</pubDate>
    <dc:creator>data_model</dc:creator>
    <dc:date>2024-07-25T17:51:21Z</dc:date>
    <item>
      <title>Left outer join on many-many relationship in Direct query Model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4056841#M54307</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to build a report on Direct query (for real-time need) based semantic model with 2 tables, and the relationship between them is&amp;nbsp;many-many due to the nature of the data. We need to create a visual mimicing the below sql. i.e., display items that exists in A but missing in B (kind of look up).&amp;nbsp;&lt;/P&gt;&lt;P&gt;select A.*&lt;/P&gt;&lt;P&gt;from tbl A left outer join tbl B&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; on A.ID = B.ID&lt;/P&gt;&lt;P&gt;where B.Name is null and A.create_dt &amp;gt; '2001-01-01'&lt;/P&gt;&lt;P&gt;I tried to create a DAX based table but it is becoming import mode and we want this to be real-time and data volume is high.&lt;/P&gt;&lt;P&gt;Probably due to direct query mode and many-many, unable to create a lookup column in A using RELATED DAX function. This seems simple but cannot get it to work ( i may be missing something). Appreciate any help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 15:18:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4056841#M54307</guid>
      <dc:creator>data_model</dc:creator>
      <dc:date>2024-07-23T15:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join on many-many relationship in Direct query Model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4057659#M54317</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/779548"&gt;@data_model&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(see&lt;EM&gt;&lt;STRONG&gt; the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please check if that is what you want. You can follow the steps below to get it:&lt;/P&gt;
&lt;P&gt;1. Create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag = 
VAR _id=SELECTEDVALUE('A'[ID])
VAR _date=SELECTEDVALUE('A'[create_dt])
RETURN IF(NOT(_id IN VALUES('B'[ID]))&amp;amp;&amp;amp;_date&amp;gt;DATE(2001,1,1),1,0)&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a table visual which the Fields options all from the table A&lt;/P&gt;
&lt;P&gt;3. Apply a visual-level filter on the above table visual with the condition (&lt;EM&gt;&lt;STRONG&gt;Flag is 1&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyiruanmsft_0-1721788897449.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1137583iCDD3CDC3495B60E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="vyiruanmsft_0-1721788897449.png" alt="vyiruanmsft_0-1721788897449.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 02:42:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4057659#M54317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-24T02:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join on many-many relationship in Direct query Model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4059889#M54339</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp; Thanks for taking time and the solution. For some reason, i couldn't be able to download your file (probably blocked in our network). But am able to borrow your code, it worked and got the result i am looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couple of observations/questions,&lt;/P&gt;&lt;P&gt;Overall response time is 3-4times longer vs using my entire sql via native/direct query ( 7000ms vs 24000ms). When i looked at the generated query (via performance analyzer), PBI produced multiple queries (one for tbl1 with all the visual columns, another for tbl1 just with the id column , another for tbl2 with it's id column) and seems join/processing happening in the PBI layer. If so, it may be a problem as these tables are large.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table visual giving the data i need, but matrix visual returns no data (i assume this may be selectedvalue function as matrix visual is just some description column and count of id).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 23:17:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4059889#M54339</guid>
      <dc:creator>data_model</dc:creator>
      <dc:date>2024-07-24T23:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join on many-many relationship in Direct query Model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4061028#M54347</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/779548"&gt;@data_model&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;How did you set your matrix visual?&amp;nbsp; Could you please provide the related Fields settings and screenshot? Thank you.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 09:17:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4061028#M54347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-25T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join on many-many relationship in Direct query Model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4062051#M54357</link>
      <description>&lt;P&gt;Here is the matrix visual setup. Both the columns in this visual are from the tbl1. Hope this helps. Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data_model_0-1721929802852.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1139082i6404D52B8B093CD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="data_model_0-1721929802852.png" alt="data_model_0-1721929802852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 17:51:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4062051#M54357</guid>
      <dc:creator>data_model</dc:creator>
      <dc:date>2024-07-25T17:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Left outer join on many-many relationship in Direct query Model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4063496#M54365</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/779548"&gt;@data_model&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a measure as below and &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;replace&lt;/STRONG&gt; &lt;/FONT&gt;[Count of ID2] with the new measure on the matrix.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _tab =
    FILTER (
        'Delta (Base)',
        NOT ( 'Delta (Base)'[ID] IN VALUES ( 'B'[ID] ) )
            &amp;amp;&amp;amp; 'Delta (Base)'[create_dt] &amp;gt; DATE ( 2022, 1, 1 )
            &amp;amp;&amp;amp; 'Delta (Base)'[create_dt] &amp;lt;&amp;gt; BLANK ()
    )
RETURN
    COUNTAX ( _tab, [ID] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyiruanmsft_0-1721986591449.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1139660i0F928829B5279069/image-size/large?v=v2&amp;amp;px=999" role="button" title="vyiruanmsft_0-1721986591449.png" alt="vyiruanmsft_0-1721986591449.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 09:37:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Left-outer-join-on-many-many-relationship-in-Direct-query-Model/m-p/4063496#M54365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-26T09:37:18Z</dc:date>
    </item>
  </channel>
</rss>

