<?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: Calculating the SUM based on another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3146124#M112547</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="394678" data-lia-user-login="Krupture" class="lia-mention lia-mention-user"&gt;Krupture&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create a measure.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = SWITCH(TRUE(),
MAX('IN SHIP'[State])="x",CALCULATE(SUM('x state Back Orders'[Back Orders]),FILTER(ALL('x state Back Orders'),'x state Back Orders'[State]=MAX('IN SHIP'[State])&amp;amp;&amp;amp; 'x state Back Orders'[Title]=MAX('IN SHIP'[Title]))),
MAX('IN SHIP'[State])="y",CALCULATE(SUM('y state Back Orders'[Back Orders]),FILTER(ALL('y state Back Orders'),'y state Back Orders'[State]=MAX('IN SHIP'[State]) &amp;amp;&amp;amp; 'y state Back Orders'[Title]=MAX('IN SHIP'[Title]))),BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2023 02:06:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-03-22T02:06:33Z</dc:date>
    <item>
      <title>Calculating the SUM based on another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3142597#M112256</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the above tables and I would like to Calculate the sum of all back orders that can be filled where the IN SHIP stock can fill, per each x and y table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the Calculate(sum(x[back orders), IN SHIP[state]="x", USERELATIONSHIP(x[title],IN SHIP[title])).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I may have to use Filter instead of userelationship, but not sure how to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:10:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3142597#M112256</guid>
      <dc:creator>Krupture</dc:creator>
      <dc:date>2023-03-20T14:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the SUM based on another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3143569#M112353</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I post this in the wrong section? Apologies if I did, any help is hugely appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 00:00:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3143569#M112353</guid>
      <dc:creator>Krupture</dc:creator>
      <dc:date>2023-03-21T00:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the SUM based on another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3146124#M112547</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="394678" data-lia-user-login="Krupture" class="lia-mention lia-mention-user"&gt;Krupture&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create a measure.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = SWITCH(TRUE(),
MAX('IN SHIP'[State])="x",CALCULATE(SUM('x state Back Orders'[Back Orders]),FILTER(ALL('x state Back Orders'),'x state Back Orders'[State]=MAX('IN SHIP'[State])&amp;amp;&amp;amp; 'x state Back Orders'[Title]=MAX('IN SHIP'[Title]))),
MAX('IN SHIP'[State])="y",CALCULATE(SUM('y state Back Orders'[Back Orders]),FILTER(ALL('y state Back Orders'),'y state Back Orders'[State]=MAX('IN SHIP'[State]) &amp;amp;&amp;amp; 'y state Back Orders'[Title]=MAX('IN SHIP'[Title]))),BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 02:06:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3146124#M112547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-22T02:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the SUM based on another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3146160#M112549</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thank you so much! I will report back on how I go with this&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 02:23:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3146160#M112549</guid>
      <dc:creator>Krupture</dc:creator>
      <dc:date>2023-03-22T02:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the SUM based on another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3162390#M113599</link>
      <description>&lt;P&gt;Apologies about the delay, due to personal circumstances. I will report back tomorrow.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 04:22:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-SUM-based-on-another-table/m-p/3162390#M113599</guid>
      <dc:creator>Krupture</dc:creator>
      <dc:date>2023-03-30T04:22:04Z</dc:date>
    </item>
  </channel>
</rss>

