<?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: How to use an aggregation spanning two 1-directional 1-to-n relationships? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4125239#M163812</link>
    <description>&lt;P&gt;Thank you very much! Your solution works&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 14:39:48 GMT</pubDate>
    <dc:creator>Albert_0122</dc:creator>
    <dc:date>2024-08-29T14:39:48Z</dc:date>
    <item>
      <title>How to use an aggregation spanning two 1-directional 1-to-n relationships?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4120727#M163598</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am currently building a report for my company and encountered the following problem: Table1 holds Orders containing Products (Table2) and Product Sets (Table2). Product Sets can contain Sub-Products (Table3). For a given value in the filter-columns (both in Table2 and Table3) we want to sum the total cost for that filter-value in the given Order. Something important to note is, that the quantity of sub-products needs to be multiplied by the quantity of their respective Product-Sets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So we basically want to do the following measurement in Table1:&lt;/P&gt;&lt;P&gt;for a given filter-value f:&amp;nbsp; quantity_2*cost_2 + cost_3*quantity_3*quantity_2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this directly using a DAX formula? Would this be a use-case, where one needs to build a temporary table using the SUMX function?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 12:28:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4120727#M163598</guid>
      <dc:creator>Albert_0122</dc:creator>
      <dc:date>2024-08-27T12:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an aggregation spanning two 1-directional 1-to-n relationships?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4121287#M163628</link>
      <description>&lt;P&gt;&lt;SPAN&gt;for a given filter-value f:&amp;nbsp; quantity_2*(cost_2 + cost_3*quantity_3)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sounds reasonable. What have you tried and where are you stuck?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 17:47:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4121287#M163628</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-08-27T17:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an aggregation spanning two 1-directional 1-to-n relationships?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4122071#M163669</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="797806" data-lia-user-login="Albert_0122" class="lia-mention lia-mention-user"&gt;Albert_0122&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on my testing, please &lt;SPAN&gt;try the following methods:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the sample table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.Create the new measure to &lt;/SPAN&gt;&lt;SPAN&gt;calculate value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;filter value = 
SUMX(
    Table2,
    Table2[quantity_2] * Table2[cost_2] +
    SUMX(
        RELATEDTABLE(Table3),
        Table3[cost_3] * Table3[quantity_3] * Table2[quantity_2]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;.Drag the measures into the matrix visual. &lt;/SPAN&gt;&lt;SPAN&gt;The result is shown below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 06:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4122071#M163669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-28T06:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an aggregation spanning two 1-directional 1-to-n relationships?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4123133#M163714</link>
      <description>&lt;P&gt;Hi lbendlin,&lt;/P&gt;&lt;P&gt;thanks for your reply. I initially solved this issue in Power Query during Ingestion by merging queries and introducing quantity_2 to Table3 (where it does not really belong). Merging the queries has an effect on performance during Ingestion. We will reimplement this report for Direct Query and I wanted to test, if solving the issue in DAX will ultimately be the superior version, since only one record from Table1 will be needed at any time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have never used SUMX or similar methods before and was wondering if this is the correct approach for this issue. I will try the solution provided by &lt;STRONG&gt;&lt;SPAN class=""&gt;v-jiewu-msft.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 15:27:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4123133#M163714</guid>
      <dc:creator>Albert_0122</dc:creator>
      <dc:date>2024-08-28T15:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an aggregation spanning two 1-directional 1-to-n relationships?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4124651#M163775</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="797806" data-lia-user-login="Albert_0122" class="lia-mention lia-mention-user"&gt;Albert_0122&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If it helps after trying it,&amp;nbsp;&lt;SPAN&gt;please consider&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wisdom Wu&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 08:43:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4124651#M163775</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-29T08:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an aggregation spanning two 1-directional 1-to-n relationships?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4125239#M163812</link>
      <description>&lt;P&gt;Thank you very much! Your solution works&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 14:39:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-an-aggregation-spanning-two-1-directional-1-to-n/m-p/4125239#M163812</guid>
      <dc:creator>Albert_0122</dc:creator>
      <dc:date>2024-08-29T14:39:48Z</dc:date>
    </item>
  </channel>
</rss>

