<?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: Calculate cumulative daily amount based selected dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3731888#M145433</link>
    <description>&lt;LI-CODE lang="markup"&gt;From has an active one to many relationship with the 'Date Table'[Date] and To has an Inactive&lt;/LI-CODE&gt;
&lt;P&gt;Make the From relationship inactive as well (or remove both).&amp;nbsp; Relationships do not help in your scenario.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use measures to overlap the Date range from the slicer with the date range From-To.&amp;nbsp; You can use (roughly)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INTERSECT(VALUES('Date Table'[Date]),CALENDAR([From],[To]))&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 00:04:58 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-02-29T00:04:58Z</dc:date>
    <item>
      <title>Calculate cumulative daily amount based selected dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3730772#M145391</link>
      <description>&lt;P&gt;Helllo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a basic table Table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;From&lt;/TD&gt;&lt;TD&gt;To&lt;/TD&gt;&lt;TD&gt;DailyAmount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/01/2024&lt;/TD&gt;&lt;TD&gt;05/2024&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From has an active one to many relationship with the 'Date Table'[Date] and To has an Inactive&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a measure that calculates a cumulative amount based on the selected dates in the Date Slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Cumulative amount should stop when the To date has been passed.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Eaxmple I choose 01/01/2024 - 10/01/2024, then the cumlative amount should be only 200&lt;BR /&gt;&lt;BR /&gt;How can I achiev this?&lt;BR /&gt;&lt;BR /&gt;I have this measure below which calculates correctly based on the selected dates&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR SelectedStartDate = MIN('Date Table'[Date])
VAR SelectedEndDate = MAX('Date Table'[Date])
RETURN
CALCULATE(
    SUMX(
        FILTER(
            ALL('Date Table'),
            'Date Table'[Date] &amp;gt;= SelectedStartDate &amp;amp;&amp;amp; 'Date Table'[Date] &amp;lt;= SelectedEndDate
        ),
        [DailyAmount] * DATEDIFF(SelectedStartDate, SelectedEndDate, DAY)
    ),
    'Date Table'[Date] &amp;lt;= MAX('Date Table'[Date])
)&lt;/LI-CODE&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;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 13:39:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3730772#M145391</guid>
      <dc:creator>JB_AT</dc:creator>
      <dc:date>2024-02-28T13:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative daily amount based selected dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3731888#M145433</link>
      <description>&lt;LI-CODE lang="markup"&gt;From has an active one to many relationship with the 'Date Table'[Date] and To has an Inactive&lt;/LI-CODE&gt;
&lt;P&gt;Make the From relationship inactive as well (or remove both).&amp;nbsp; Relationships do not help in your scenario.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use measures to overlap the Date range from the slicer with the date range From-To.&amp;nbsp; You can use (roughly)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INTERSECT(VALUES('Date Table'[Date]),CALENDAR([From],[To]))&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 00:04:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3731888#M145433</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-29T00:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative daily amount based selected dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3732544#M145462</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;Thank you for your reply&lt;BR /&gt;&lt;BR /&gt;I have tried implementing this into my scenario and looked at documentation and videos on Intersect, but I can't get it.&lt;BR /&gt;&lt;BR /&gt;If you have time, how would you build it in to my measure above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 06:36:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3732544#M145462</guid>
      <dc:creator>JB_AT</dc:creator>
      <dc:date>2024-02-29T06:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative daily amount based selected dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3732780#M145472</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="626251" data-lia-user-login="JB_AT" class="lia-mention lia-mention-user"&gt;JB_AT&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I don't think the one-to-many relationship of 'From' can help filter the data in 'Date Table'. It is recommended that you create a continuous date column using the row values of the 'From' column and the row values of the 'To' column.&lt;BR /&gt;Use the following DAX expression to create a table :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALENDAR(DATE([From].year,[From].MonthNo,[From].day),DATE([To].year,[To].MonthNo,[To].day))&lt;/LI-CODE&gt;&lt;P&gt;Create a one-to-many relationship between the created table and the 'Date Table'. Add the date column of the created table to the slicer.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 07:48:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3732780#M145472</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-29T07:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative daily amount based selected dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3744403#M146016</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 00:20:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-daily-amount-based-selected-dates/m-p/3744403#M146016</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-06T00:20:59Z</dc:date>
    </item>
  </channel>
</rss>

