<?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 duration between date-time of consecutie date-time rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-duration-between-date-time-of-consecutie-date-time/m-p/3800932#M148601</link>
    <description>&lt;P&gt;This solution seems to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DurationBetween =&lt;BR /&gt;VAR CurrentDateTime = df[date-time]&lt;BR /&gt;VAR NextDateTime =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN(df[date-time]),&lt;BR /&gt;FILTER(&lt;BR /&gt;df,&lt;BR /&gt;df[date-time] &amp;gt; CurrentDateTime&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;ISBLANK(NextDateTime),&lt;BR /&gt;BLANK(),&lt;BR /&gt;(NextDateTime - CurrentDateTime)*24*60&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Sun, 31 Mar 2024 18:19:51 GMT</pubDate>
    <dc:creator>logicscience2</dc:creator>
    <dc:date>2024-03-31T18:19:51Z</dc:date>
    <item>
      <title>calculate duration between date-time of consecutie date-time rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-duration-between-date-time-of-consecutie-date-time/m-p/3800921#M148599</link>
      <description>&lt;P&gt;I have data of this format :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;during import the data is sorted by date-time column then the Index column is added. So regardless how the table is sorted after import, the index can maintain a reference to sequential date-time values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add the duration-between calculated column which will calculate the difference between two rows based on the index order so in the picture above the first row would be blank or error, the second row would be 235 (minutes), the third would be&amp;nbsp; 52 (minutes) and so on. These values would stay correctly calculated regardless of the ordering on the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 17:41:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-duration-between-date-time-of-consecutie-date-time/m-p/3800921#M148599</guid>
      <dc:creator>logicscience2</dc:creator>
      <dc:date>2024-03-31T17:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculate duration between date-time of consecutie date-time rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-duration-between-date-time-of-consecutie-date-time/m-p/3800932#M148601</link>
      <description>&lt;P&gt;This solution seems to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DurationBetween =&lt;BR /&gt;VAR CurrentDateTime = df[date-time]&lt;BR /&gt;VAR NextDateTime =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN(df[date-time]),&lt;BR /&gt;FILTER(&lt;BR /&gt;df,&lt;BR /&gt;df[date-time] &amp;gt; CurrentDateTime&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;ISBLANK(NextDateTime),&lt;BR /&gt;BLANK(),&lt;BR /&gt;(NextDateTime - CurrentDateTime)*24*60&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 18:19:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-duration-between-date-time-of-consecutie-date-time/m-p/3800932#M148601</guid>
      <dc:creator>logicscience2</dc:creator>
      <dc:date>2024-03-31T18:19:51Z</dc:date>
    </item>
  </channel>
</rss>

