<?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 Calculate between two fact tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2926922#M96198</link>
    <description>&lt;P&gt;Dear Forum Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First time posting here.&amp;nbsp; Hope you could help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two fact tables as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Each "Staff" could be associated to one or *more* "Department" in every month.&amp;nbsp;&amp;nbsp;Each "Department" has one "Income" every month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each Staff, I need to get the "Total Income" and the "Average Income", across all the "Department" he/she associated to.&amp;nbsp; Two values required: a) total and average across all the months, b) total and average in each month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the DAX measure code to get these values?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, in my visual, I will plot graph/table showing the value for each month, using "Calendar[Month]" as my axis/row.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kar Ann&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 11:00:29 GMT</pubDate>
    <dc:creator>chewkarann</dc:creator>
    <dc:date>2022-11-24T11:00:29Z</dc:date>
    <item>
      <title>Calculate between two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2926922#M96198</link>
      <description>&lt;P&gt;Dear Forum Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First time posting here.&amp;nbsp; Hope you could help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two fact tables as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Each "Staff" could be associated to one or *more* "Department" in every month.&amp;nbsp;&amp;nbsp;Each "Department" has one "Income" every month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each Staff, I need to get the "Total Income" and the "Average Income", across all the "Department" he/she associated to.&amp;nbsp; Two values required: a) total and average across all the months, b) total and average in each month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the DAX measure code to get these values?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, in my visual, I will plot graph/table showing the value for each month, using "Calendar[Month]" as my axis/row.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kar Ann&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 11:00:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2926922#M96198</guid>
      <dc:creator>chewkarann</dc:creator>
      <dc:date>2022-11-24T11:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate between two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2926949#M96201</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="476853" data-lia-user-login="chewkarann" class="lia-mention lia-mention-user"&gt;chewkarann&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure Each Month =
  VAR __StaffDept = DISTINCT('Fact Staff'[Department])
  VAR __Table = FILTER('Fact Department', [Department] IN __StaffDept)
  VAR __Total = SUMX(__Table, [Income])
  VAR __Average = AVERAGEX(__Table, [Income])
  VAR __Result = __Total // __Average
RETURN
  __Result


Measure All Months =
  VAR __StaffDept = DISTINCT('Fact Staff'[Department])
  VAR __Table = FILTER(ALL('Fact Department'), [Department] IN __StaffDept)
  VAR __Total = SUMX(__Table, [Income])
  VAR __Average = AVERAGEX(__Table, [Income])
  VAR __Result = __Total // __Average
RETURN
  __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Nov 2022 11:14:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2926949#M96201</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-11-24T11:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate between two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2931930#M96474</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="476853" data-lia-user-login="chewkarann" class="lia-mention lia-mention-user"&gt;chewkarann&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If these also don't help, please share more detailed information to help us clarify your scenario to test.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 06:09:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2931930#M96474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-28T06:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate between two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2957217#M98282</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;THANKS so much, Greg!!&amp;nbsp; And sorry for the late reply.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 15:48:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-between-two-fact-tables/m-p/2957217#M98282</guid>
      <dc:creator>chewkarann</dc:creator>
      <dc:date>2022-12-08T15:48:30Z</dc:date>
    </item>
  </channel>
</rss>

