<?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: Using DAX to get delta for consecutive snapshots... in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2862681#M92221</link>
    <description>&lt;P&gt;Thanks but I figured it out. For anyone who needs it, I added a Measure like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Next Snapshot Orders = 
var nxt = CALCULATE(MIN(MySnapshots[SnapshotDate]), FILTER(MySnapshots, MySnapshots[SnapshotDate]&amp;gt;SELECTEDVALUE(MySnapshots[SnapshotDate])))
RETURN CALCULATE(SUM(MySnapshots[Orders]), REMOVEFILTERS(MySnapshots[SnapshotDate]), MySnapshots[SnapshotDate]=nxt)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gets the snapshot date after the current selectedvalue (which will be determined by the SnapshotDate in my Chart/Table, but it could just as easily be determined by a selection in a slicer or whatever).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I SUM the "Orders" from the snapshot tables for the NEXT snapshot, removing ONLY the SnapshotDate filter from the current table. This way, all of my other criteria (in my chart/table/page/etc) is retained and the only thing I'm changing is which Snapshot I'm using to get my SUM.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This Measure only shows how to get the total for the "next" snapshot's Orders. That's not everything I mentioned above, because ultimately I'm going to combine Shipments and Orders for the "next" snapshot and compare them to Shipments/Orders from the "selected" snapshot (in the chart/table) and calc the delta, but this is the bulk of what is needed to do what I need. All I have to do to see the current snapshot's Orders vs the next snapshot's Orders is create a table with SnapshotDate on it, add Orders, then add my Next Snapshot Orders measure and I can see them side-by-side.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 20:21:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-25T20:21:52Z</dc:date>
    <item>
      <title>Using DAX to get delta for consecutive snapshots...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2860186#M92083</link>
      <description>&lt;P&gt;I need to get a running daily delta of consecutive snapshots for certain dimensions/facts. So, let's say I have three Dims:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Customer, Part, Group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and two Facts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shipments, Orders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every day I'm going to take a snapshot of these Dims/Facts and give them a SnapshotDate (i.e. the date the snapshot was taken). I want to plot SnapshotDate on a chart and show the following as the value:&lt;BR /&gt;&lt;BR /&gt;SUM of a given Fact (at any given Dimension) for each SnapshotDate MINUS the SUM for that same Fact (at those same Dimensions) for the PRIOR SnapshotDate.&lt;BR /&gt;&lt;BR /&gt;So, the 10/24 delta would be (10/24 - 10/23), the 10/23 delta would be (10/23 - 10/22), and so on...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is this possible using DAX? I could do it with SQL, but I'm trying to make use of the existing data in the Dataset instead of pulling in Deltas as data.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 22:59:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2860186#M92083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-24T22:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using DAX to get delta for consecutive snapshots...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2861330#M92156</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please provide me some sample data for testing? Please delete the private data.&lt;/P&gt;
&lt;P&gt;And could I ask that what kind of result do you want? A visual or a table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Community Support Team _Yinliw&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 09:15:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2861330#M92156</guid>
      <dc:creator>v-yinliw-msft</dc:creator>
      <dc:date>2022-10-25T09:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using DAX to get delta for consecutive snapshots...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2862681#M92221</link>
      <description>&lt;P&gt;Thanks but I figured it out. For anyone who needs it, I added a Measure like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Next Snapshot Orders = 
var nxt = CALCULATE(MIN(MySnapshots[SnapshotDate]), FILTER(MySnapshots, MySnapshots[SnapshotDate]&amp;gt;SELECTEDVALUE(MySnapshots[SnapshotDate])))
RETURN CALCULATE(SUM(MySnapshots[Orders]), REMOVEFILTERS(MySnapshots[SnapshotDate]), MySnapshots[SnapshotDate]=nxt)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gets the snapshot date after the current selectedvalue (which will be determined by the SnapshotDate in my Chart/Table, but it could just as easily be determined by a selection in a slicer or whatever).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I SUM the "Orders" from the snapshot tables for the NEXT snapshot, removing ONLY the SnapshotDate filter from the current table. This way, all of my other criteria (in my chart/table/page/etc) is retained and the only thing I'm changing is which Snapshot I'm using to get my SUM.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This Measure only shows how to get the total for the "next" snapshot's Orders. That's not everything I mentioned above, because ultimately I'm going to combine Shipments and Orders for the "next" snapshot and compare them to Shipments/Orders from the "selected" snapshot (in the chart/table) and calc the delta, but this is the bulk of what is needed to do what I need. All I have to do to see the current snapshot's Orders vs the next snapshot's Orders is create a table with SnapshotDate on it, add Orders, then add my Next Snapshot Orders measure and I can see them side-by-side.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:21:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-to-get-delta-for-consecutive-snapshots/m-p/2862681#M92221</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-25T20:21:52Z</dc:date>
    </item>
  </channel>
</rss>

