<?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: Cumulative Sum Measure from historical data based on a past date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3543877#M136248</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;that worked, and I also got this to work just before I read your message:&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;BR /&gt;SUM(Table[CapacityKg]),&lt;BR /&gt;FILTER (&lt;BR /&gt;AllSelected( Table),&lt;BR /&gt;LoadGraphHistory[Week] &amp;lt;= MAX( Table[Week] )&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;So this is solved, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My solution with Allselected isnt as good in many situations (depending on the use case, obviously), so I might use your solution instead.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2023 06:46:04 GMT</pubDate>
    <dc:creator>HopefulQuestion</dc:creator>
    <dc:date>2023-11-21T06:46:04Z</dc:date>
    <item>
      <title>Cumulative Sum Measure from historical data based on a past date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3533128#M135762</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data like this saved for various dates in history:&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;SnapShotDate&lt;/TD&gt;&lt;TD&gt;Week&lt;/TD&gt;&lt;TD&gt;CapacityForDay&lt;/TD&gt;&lt;TD&gt;CapacityKg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12.4.2023&lt;/TD&gt;&lt;TD&gt;202335&lt;/TD&gt;&lt;TD&gt;29.09.2023&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12.4.2023&lt;/TD&gt;&lt;TD&gt;202334&lt;/TD&gt;&lt;TD&gt;22.09.2023&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12.4.2023&lt;/TD&gt;&lt;TD&gt;202333&lt;/TD&gt;&lt;TD&gt;15.09.2023&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30-50 SnapshotDates&lt;/TD&gt;&lt;TD&gt;15-25 weeks for each snapshot - many snapshots will have rows for the same weeks&lt;/TD&gt;&lt;TD&gt;The capacities are on day level, but users will always view their sum on week level. So this date always belongs to the week specified in the Week column&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Capacity varies&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea is that&amp;nbsp;user will select which Snapshotdate data they will view (so &lt;STRONG&gt;always only 1 SnapshotDate&lt;/STRONG&gt;&amp;nbsp;is selected), and then they can view what was the capacity forecast for the various weeks on that Date.&lt;/P&gt;&lt;P&gt;I have similar data for 5 other numerical attributes besides Capacity, but they are not relevant here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a cumulative sum Measure for capacity of all future weeks from that SnapshotDate forwards, and I just cannot get it right. All snapshots are from mondays (the date in the table above might not be a monday, its just a random example).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of expected result in PowerBI:&lt;/P&gt;&lt;P&gt;SnapShotDate= 12.04.2023 (selected filter)&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;202333&lt;/TD&gt;&lt;TD&gt;202334&lt;/TD&gt;&lt;TD&gt;202335&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;Week X&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Some Value A&lt;/TD&gt;&lt;TD&gt;202334Value+A=B&lt;/TD&gt;&lt;TD&gt;202335Value+B=C&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Sum of all rows with the selected week X, where&amp;nbsp;CapacityForDay &amp;gt;=SnapShotDate +&amp;nbsp;&lt;U&gt;Sum of previous weeks before X&lt;/U&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;U&gt;*Edited message, as original example was really bad and didnt highlight the need is cumulative sum based on the progressing weeks, with the additional conditions Table[CapacityForDay ]&amp;gt;=Table[SnapshotDate] and selected date&amp;nbsp;12.04.2023.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried dozens of variations of this;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM(Table[CapacityKg]),&lt;BR /&gt;FILTER (&lt;BR /&gt;ALLEXCEPT(Table,Table[SnapshotDate]),&lt;BR /&gt;Table[Week] &amp;lt;= MAX ( Table[Week] )&lt;BR /&gt;), Table[CapacityForDay ]&amp;gt;=Table[SnapshotDate]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with changing the ALLEXCEPT /ALL / FILTER, but never getting the result I need.&lt;/P&gt;&lt;P&gt;I have a feeling the adjustment needed for that is very small, but for some reason I just cannot get it right.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 15:33:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3533128#M135762</guid>
      <dc:creator>HopefulQuestion</dc:creator>
      <dc:date>2023-11-14T15:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum Measure from historical data based on a past date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3533298#M135769</link>
      <description>&lt;P&gt;From what you described above, a simple&amp;nbsp;&lt;SPAN&gt;SUM(Table[CapacityKg]) would do the trick.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;If it doesn't you should add some more info&amp;nbsp;on the actual data and the visuals.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 15:25:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3533298#M135769</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-11-14T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum Measure from historical data based on a past date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3533317#M135770</link>
      <description>&lt;P&gt;Apologies for the horribly unclear example: I tried to make it more clear that I want a cumulative sum based on the weeks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 15:34:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3533317#M135770</guid>
      <dc:creator>HopefulQuestion</dc:creator>
      <dc:date>2023-11-14T15:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum Measure from historical data based on a past date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3536386#M135893</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="646091" data-lia-user-login="HopefulQuestion" class="lia-mention lia-mention-user"&gt;HopefulQuestion&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;BR /&gt;Measure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Sum = CALCULATE(SUM('Table'[CapacityKg]),FILTER(ALL('Table'),[Week]&amp;lt;=SELECTEDVALUE('Table'[Week])))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expected? If not, please provide more example data and desired results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;helps, then please consider&amp;nbsp;&lt;EM&gt;Accept it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 06:39:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3536386#M135893</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-11-16T06:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Sum Measure from historical data based on a past date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3543877#M136248</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;that worked, and I also got this to work just before I read your message:&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;BR /&gt;SUM(Table[CapacityKg]),&lt;BR /&gt;FILTER (&lt;BR /&gt;AllSelected( Table),&lt;BR /&gt;LoadGraphHistory[Week] &amp;lt;= MAX( Table[Week] )&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;So this is solved, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My solution with Allselected isnt as good in many situations (depending on the use case, obviously), so I might use your solution instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 06:46:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-Measure-from-historical-data-based-on-a-past-date/m-p/3543877#M136248</guid>
      <dc:creator>HopefulQuestion</dc:creator>
      <dc:date>2023-11-21T06:46:04Z</dc:date>
    </item>
  </channel>
</rss>

