<?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: Calculated Column - SUM values in another table based on IDs equal to each other in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-SUM-values-in-another-table-based-on-IDs-equal/m-p/4024192#M158838</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="514280" data-lia-user-login="jasmin_w" class="lia-mention lia-mention-user"&gt;jasmin_w&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I create two tables as you mentioned.&lt;/P&gt;
&lt;P&gt;&lt;img /&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;Then I create two calculated columns and get what you want.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
SUMX ( FILTER ( 'T2', 'T2'[Peiod] = 'T1'[Peiod] ), 'T2'[Amount] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column 2 = 
SUMX ( FILTER ( 'T1', 'T1'[Peiod] &amp;lt;= EARLIER ( T1[Peiod] ) ), 'T1'[Column] )&lt;/LI-CODE&gt;
&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;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 05:41:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-04T05:41:19Z</dc:date>
    <item>
      <title>Calculated Column - SUM values in another table based on IDs equal to each other</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-SUM-values-in-another-table-based-on-IDs-equal/m-p/4023049#M158756</link>
      <description>&lt;P&gt;I am trying to create a calculated column based on the SUM of values in another table where the IDs match each other.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 tables:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Sales Roster - contains one row per Employee&lt;/LI&gt;&lt;LI&gt;Revenue - contains all revenue data with multiple rows per Employee with multiple employee columns.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is already an existing many-to-one relationship between 'Revenue[Geo Owner ID] and 'Sales Roster'[EmpID]. Most revenue is reported this way and under this relationship. This is considered Core revenue and all revenue is summed under the 'Sales Roster'[EmpID].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally I would like to create a calculated column that reports on the revenue a different way, which is Collaboration revenue. I pretty much want it to do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE ( SUM ('Revenue'[Revenue USD]), 'Revenue'[Account Owner ID] = 'Sales Roster'[EmpID] ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortuntately, it has not been this simple because the 2 tables already have an existing relationship and the 'Revenue' table has many duplicates in the 'Revenue'[Account Owner ID].&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some methods I have attempted:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;VAR _revenueID = FIRSTNONBLANK('Revenue'[Account Owner ID], 1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; VAR _rosterID = FIRSTNONBLANKVALUE('Sales Roster'[EmpID] , 1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; RETURN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SUMX(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; FILTER( 'Revenue', _revenueID = _rosterID),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 'Revenue'[Revenue_USD] )&lt;/LI&gt;&lt;LI&gt;CALCULATE(&lt;BR /&gt;SUM( 'Revenue'[Revenue_USD),&lt;BR /&gt;'Sales Roster'[EmpID] = FIRSTNONBLANK('Revenue'[Account Owner ID], 1 )&lt;BR /&gt;)&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 14:13:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-SUM-values-in-another-table-based-on-IDs-equal/m-p/4023049#M158756</guid>
      <dc:creator>jasmin_w</dc:creator>
      <dc:date>2024-07-03T14:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column - SUM values in another table based on IDs equal to each other</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-SUM-values-in-another-table-based-on-IDs-equal/m-p/4024192#M158838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="514280" data-lia-user-login="jasmin_w" class="lia-mention lia-mention-user"&gt;jasmin_w&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I create two tables as you mentioned.&lt;/P&gt;
&lt;P&gt;&lt;img /&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;Then I create two calculated columns and get what you want.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
SUMX ( FILTER ( 'T2', 'T2'[Peiod] = 'T1'[Peiod] ), 'T2'[Amount] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column 2 = 
SUMX ( FILTER ( 'T1', 'T1'[Peiod] &amp;lt;= EARLIER ( T1[Peiod] ) ), 'T1'[Column] )&lt;/LI-CODE&gt;
&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;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 05:41:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-SUM-values-in-another-table-based-on-IDs-equal/m-p/4024192#M158838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-04T05:41:19Z</dc:date>
    </item>
  </channel>
</rss>

