<?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: Many to many relationship sum by product in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2749619#M84792</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/437360"&gt;@Zaoka900&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please check the relationship like the following.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpollymsft_0-1662451128713.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778553iF817C9157EB2BFC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="vpollymsft_0-1662451128713.png" alt="vpollymsft_0-1662451128713.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then create 2 measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Meastest =
CALCULATE (
    SUM ( 'Import'[Value] ),
    FILTER (
        ALL ( 'Import' ),
        'Import'[SKU code] = SELECTEDVALUE ( 'SKU detail'[SKU code] )
    )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;correct result =
CALCULATE (
    SUM ( Sales[Value] ),
    FILTER (
        ALL ( Sales ),
        Sales[SKU code] = SELECTEDVALUE ( 'SKU detail'[SKU code] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpollymsft_1-1662451240235.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778555i1B5CFD45BF75727D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vpollymsft_1-1662451240235.png" alt="vpollymsft_1-1662451240235.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, please provide more details with your desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpollymsft_2-1662451283779.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778556iB49BC1A398F4539D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vpollymsft_2-1662451283779.png" alt="vpollymsft_2-1662451283779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution 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>Tue, 06 Sep 2022 08:02:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-06T08:02:05Z</dc:date>
    <item>
      <title>Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2747998#M84708</link>
      <description>&lt;P&gt;Hi, if someone can help me with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I have 3 tables: import, sales, and product details connected with relationship.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create measure that show sales by product in import table, so when I filter import date i see total sales by product and imports only for filtered date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_1.png" style="width: 503px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778046i4DE63D168FF7F0D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_1.png" alt="Screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_2.png" style="width: 764px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778048i32C30814963A62BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_2.png" alt="Screenshot_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;excel example&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/vgtqao0yxnjg613/Import.Sales.xlsx?dl=0" target="_blank" rel="noopener"&gt;https://www.dropbox.com/s/vgtqao0yxnjg613/Import.Sales.xlsx?dl=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 13:53:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2747998#M84708</guid>
      <dc:creator>Zaoka900</dc:creator>
      <dc:date>2022-09-05T13:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748082#M84712</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/437360"&gt;@Zaoka900&lt;/a&gt; , You also need to have a common date table &lt;/P&gt;
&lt;P&gt;&lt;A href="https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda" target="_blank"&gt;https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When I asked you to create common tables: &lt;A href="https://youtu.be/a2CrqCA9geM" target="_blank"&gt;https://youtu.be/a2CrqCA9geM&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 14:34:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748082#M84712</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-05T14:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748145#M84716</link>
      <description>&lt;P&gt;OK, I created date dimension but not sure what to do now, result is same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If needed i can change Sales Query by Group SKU without Date. I think i need formula in measure in Import that should somehow show total sales per SKU code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In reality i dont want to filter Sales Date, only Import Date.&amp;nbsp; Sales should always show total per SKU,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_3.png" style="width: 731px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778087iB00F3C3EF8817BBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_3.png" alt="Screenshot_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 15:14:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748145#M84716</guid>
      <dc:creator>Zaoka900</dc:creator>
      <dc:date>2022-09-05T15:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748225#M84718</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/437360"&gt;@Zaoka900&lt;/a&gt; , 2 ways, do not join sales and date table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or create a sales measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;calculate(sum(Sales[Value]), all('Date'))&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 15:56:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748225#M84718</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-05T15:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748542#M84727</link>
      <description>&lt;P&gt;sorry Amit, result is same, it just repeat total sales for every SKU...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculate(sum(Sales[Value]), all('Date'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have time check on my dropbox link with example data.&lt;/P&gt;&lt;P&gt;Maybe i'm doing something wrong...&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 18:33:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2748542#M84727</guid>
      <dc:creator>Zaoka900</dc:creator>
      <dc:date>2022-09-05T18:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2749619#M84792</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/437360"&gt;@Zaoka900&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please check the relationship like the following.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpollymsft_0-1662451128713.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778553iF817C9157EB2BFC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="vpollymsft_0-1662451128713.png" alt="vpollymsft_0-1662451128713.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then create 2 measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Meastest =
CALCULATE (
    SUM ( 'Import'[Value] ),
    FILTER (
        ALL ( 'Import' ),
        'Import'[SKU code] = SELECTEDVALUE ( 'SKU detail'[SKU code] )
    )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;correct result =
CALCULATE (
    SUM ( Sales[Value] ),
    FILTER (
        ALL ( Sales ),
        Sales[SKU code] = SELECTEDVALUE ( 'SKU detail'[SKU code] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpollymsft_1-1662451240235.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778555i1B5CFD45BF75727D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vpollymsft_1-1662451240235.png" alt="vpollymsft_1-1662451240235.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, please provide more details with your desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpollymsft_2-1662451283779.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/778556iB49BC1A398F4539D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vpollymsft_2-1662451283779.png" alt="vpollymsft_2-1662451283779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution 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>Tue, 06 Sep 2022 08:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2749619#M84792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-06T08:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2751432#M84903</link>
      <description>&lt;P&gt;Because i'm trying to build this in Power Pivot - Data model, there si no function SELECTEDVALUE so i change code like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MasterTest=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE (
    SUM ( 'Import'[Value] );
    FILTER (
        ALL ( 'Import' );
        'Import'[SKU code] = (IF ( HASONEVALUE ( Detail[SKU code] );VALUES ( Detail[SKU code] ) ))
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But result is blank cell, i dont... i tried&amp;nbsp; with and without relationship&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_4.png" style="width: 477px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/779027iA64A6335A3BFF624/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_4.png" alt="Screenshot_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 21:37:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2751432#M84903</guid>
      <dc:creator>Zaoka900</dc:creator>
      <dc:date>2022-09-06T21:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2751838#M84926</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/437360"&gt;@Zaoka900&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can change the formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE (
    SUM ( 'Import'[Value] );
    FILTER (
        ALL ( 'Import' );
        'Import'[SKU code] = max(detail[sku])))&lt;/LI-CODE&gt;
&lt;P&gt;If I have misunderstood your meaning, please provide more details and pbix file without privacy information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;Best Regards&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;Community Support Team _ Polly&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 03:14:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2751838#M84926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-07T03:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2752130#M84941</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried your suggestion with Max, result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Zaoka900_0-1662532219607.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/779223i37BD5E688B05DA15/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Zaoka900_0-1662532219607.png" alt="Zaoka900_0-1662532219607.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure how to upload file, because i do all this directly in excel data model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;only dropbox link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/vgtqao0yxnjg613/Import.Sales.xlsx?dl=0" target="_blank"&gt;https://www.dropbox.com/s/vgtqao0yxnjg613/Import.Sales.xlsx?dl=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 06:35:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2752130#M84941</guid>
      <dc:creator>Zaoka900</dc:creator>
      <dc:date>2022-09-07T06:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Many to many relationship sum by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2753463#M85010</link>
      <description>&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;this code work, tnx @Anonymous&amp;nbsp; for idea&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=CALCULATE (
    SUM ( Sales[Value] );
    FILTER (
        ALL ( Sales );
        Sales[SKU code] = (IF ( HASONEVALUE ( 'Import'[SKU code]);VALUES ( 'Import'[SKU code] ) ))
        
            )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 15:05:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Many-to-many-relationship-sum-by-product/m-p/2753463#M85010</guid>
      <dc:creator>Zaoka900</dc:creator>
      <dc:date>2022-09-07T15:05:08Z</dc:date>
    </item>
  </channel>
</rss>

