<?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: Tricky SUM with two tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3244732#M119480</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56154" data-lia-user-login="clubspec" class="lia-mention lia-mention-user"&gt;clubspec&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;Total Depreciation =&lt;BR /&gt;VAR CurrentDate =&lt;BR /&gt;MIN ( 'Calendar'[Date] )&lt;BR /&gt;VAR T1 =&lt;BR /&gt;CALCULATETABLE ( 'Asset Register', ALL ( 'Calendar' ) )&lt;BR /&gt;VAR T2 =&lt;BR /&gt;FILTER (&lt;BR /&gt;T1,&lt;BR /&gt;'Asset Register'[Start Date] &amp;lt;= CurrentDate&lt;BR /&gt;&amp;amp;&amp;amp; 'Asset Register'[End Date] &amp;gt;= CurrentDate&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX ( T3, 'Asset Register'[Monthly Depreciation] )&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2023 17:01:21 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-05-19T17:01:21Z</dc:date>
    <item>
      <title>Tricky SUM with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3243595#M119405</link>
      <description>&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;I have two tables like in the picture.&amp;nbsp; There is a relationship between 'Calendar'[Date] and 'Asset Register'[Start Date].&lt;/P&gt;&lt;P&gt;Now I want to do a sum for [Monthly Depreciation] from the Asset Register table, however use the [Year] and [Month] from the 'Calendar' table as the row element to display the result.&amp;nbsp; The requirement is simple, sum rows in column 'Asset Register'[Monthly Depreciation] if 'Calendar'[Year] and [Month] (e.g. 1 Jan 23) is between the 'Asset Register'[Start Date] and [End Date].&lt;/P&gt;&lt;P&gt;I have tried so many dax but couldn't work out the correct answer (also in the picture below).&amp;nbsp; I know the relationship cause part of the problem but I cannot remove it because there are other measures using it.&lt;/P&gt;&lt;P&gt;Please help...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 04:31:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3243595#M119405</guid>
      <dc:creator>clubspec</dc:creator>
      <dc:date>2023-05-19T04:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky SUM with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3243693#M119415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56154" data-lia-user-login="clubspec" class="lia-mention lia-mention-user"&gt;clubspec&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that your data, at least from picture, for Calendar / Date Table seems find (one day / date as unique and that table as Date table featured in PowerBI).&lt;/P&gt;&lt;P&gt;Still to "leverage" PowerBI features for calculating&amp;nbsp; / reporting MTD amounts your data should be on respective granularity, meaning one single date: day or monthly level only. It will be great if you already have or you could have that level of data per asset item. It is a bit confusing seeing your column "Monthly Depreciation" and next two dates like period. It could be that you need to use PQ transformation or somehow prepare that to be with just one monthly dates / amounts, &lt;EM&gt;&lt;STRONG&gt;before any DAX&lt;/STRONG&gt;&lt;/EM&gt;. I do not know it by heart :). I hope this help.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 06:17:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3243693#M119415</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-05-19T06:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky SUM with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3244668#M119472</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56154" data-lia-user-login="clubspec" class="lia-mention lia-mention-user"&gt;clubspec&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the CROSSFILTER function to remove the relationship just for this measure.&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Monthly Dep = 
VAR _MaxDate = MAX('Date'[Date])
VAR _Result = 
CALCULATE(
    SUM('Asset Register'[Monthly depreciation]),
    CROSSFILTER('Date'[Date], 'Asset Register'[Start Date], None),
    'Asset Register'[Start Date] &amp;lt;= _MaxDate,
    'Asset Register'[End Date] &amp;gt;= _MaxDate
)
RETURN
    _Result&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 16:21:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3244668#M119472</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2023-05-19T16:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky SUM with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3244732#M119480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56154" data-lia-user-login="clubspec" class="lia-mention lia-mention-user"&gt;clubspec&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;Total Depreciation =&lt;BR /&gt;VAR CurrentDate =&lt;BR /&gt;MIN ( 'Calendar'[Date] )&lt;BR /&gt;VAR T1 =&lt;BR /&gt;CALCULATETABLE ( 'Asset Register', ALL ( 'Calendar' ) )&lt;BR /&gt;VAR T2 =&lt;BR /&gt;FILTER (&lt;BR /&gt;T1,&lt;BR /&gt;'Asset Register'[Start Date] &amp;lt;= CurrentDate&lt;BR /&gt;&amp;amp;&amp;amp; 'Asset Register'[End Date] &amp;gt;= CurrentDate&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX ( T3, 'Asset Register'[Monthly Depreciation] )&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 17:01:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3244732#M119480</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-19T17:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky SUM with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3246257#M119601</link>
      <description>&lt;P&gt;Thank you so much Paul, it is working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 02:17:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tricky-SUM-with-two-tables/m-p/3246257#M119601</guid>
      <dc:creator>clubspec</dc:creator>
      <dc:date>2023-05-22T02:17:54Z</dc:date>
    </item>
  </channel>
</rss>

