<?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: How can I calculate the sum of the time between many updates from the same ticket ID. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4633948#M177403</link>
    <description>&lt;P&gt;This can be done with a DATEDIFF measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ticket Duration (Days) = 
DATEDIFF( 
    MIN( 'Table'[Comment date (UTC)] ), 
    MAX( 'Table'[Comment date (UTC)] ), 
    HOUR 
) / 24&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output in a table visual (with Totals off):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;In case you need duration in d:hh:mm:ss format rather than as a decimal in days:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ticket Duration (d:hh:mm:ss) = 
VAR _secsDifTotal = 
DATEDIFF( 
    MIN( 'Table'[Comment date (UTC)] ), 
    MAX( 'Table'[Comment date (UTC)] ), 
    SECOND 
)
VAR _secsPerDay = 24 * 60 * 60
VAR _dayPart = INT( _secsDifTotal / _secsPerDay )
VAR _timePart = MOD( _secsDifTotal, _secsPerDay ) / _secsPerDay
RETURN
_dayPart &amp;amp; ":" &amp;amp; FORMAT( _timePart, "hh:mm:ss" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 23:58:00 GMT</pubDate>
    <dc:creator>MarkLaf</dc:creator>
    <dc:date>2025-04-01T23:58:00Z</dc:date>
    <item>
      <title>How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4624737#M177024</link>
      <description>&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask for support because&amp;nbsp;I need to know the sum of the time between each update of the same ticket.&lt;/P&gt;&lt;P&gt;And in the end, for ticket XXXXXX&amp;nbsp; we had a total of hh:mm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will provide just 2 samples of tickets, but I have many more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many tks for the supporting.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 19:15:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4624737#M177024</guid>
      <dc:creator>FelippeAzevedo7</dc:creator>
      <dc:date>2025-03-25T19:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4624777#M177028</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736722" data-lia-user-login="FelippeAzevedo7" class="lia-mention lia-mention-user"&gt;FelippeAzevedo7&lt;/a&gt;&amp;nbsp;I would suggest this pattern as a calculated column potentially.&amp;nbsp;See my article on Mean Time Between Failure (MTBF) which uses EARLIER: &lt;A href="http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586" target="_blank"&gt;http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586&lt;/A&gt;.&lt;BR /&gt;The basic pattern is:&lt;BR /&gt;Column =&amp;nbsp;&lt;BR /&gt;&amp;nbsp; VAR __Current = [Value]&lt;BR /&gt;&amp;nbsp; VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] &amp;lt; EARLIER('Table'[Date])),[Date])&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp;( __Current - __Previous ) * 1.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 20:25:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4624777#M177028</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2025-03-25T20:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4624837#M177029</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736722" data-lia-user-login="FelippeAzevedo7" class="lia-mention lia-mention-user"&gt;FelippeAzevedo7&lt;/a&gt;&amp;nbsp;please check this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&l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N&gt;'Sheet15'&lt;/SPAN&gt;&lt;SPAN&gt;[Previous_Comment_Date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Sheet15'&lt;/SPAN&gt;&lt;SPAN&gt;[Comment date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;HOUR&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;measure&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total_Hours_Per_Ticket =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sheet15'&lt;/SPAN&gt;&lt;SPAN&gt;[Duration_Hours]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sheet15'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Sheet15'&lt;/SPAN&gt;&lt;SPAN&gt;[Ticket ID]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Mar 2025 21:04:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4624837#M177029</guid>
      <dc:creator>techies</dc:creator>
      <dc:date>2025-03-25T21:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4631478#M177330</link>
      <description>&lt;P&gt;Hello Greg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How are you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me explain once more, because I don't think I've made it clear.&lt;BR /&gt;I need to know the total time between dates for the same ticket.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 12:00:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4631478#M177330</guid>
      <dc:creator>FelippeAzevedo7</dc:creator>
      <dc:date>2025-03-31T12:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4633948#M177403</link>
      <description>&lt;P&gt;This can be done with a DATEDIFF measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ticket Duration (Days) = 
DATEDIFF( 
    MIN( 'Table'[Comment date (UTC)] ), 
    MAX( 'Table'[Comment date (UTC)] ), 
    HOUR 
) / 24&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output in a table visual (with Totals off):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;In case you need duration in d:hh:mm:ss format rather than as a decimal in days:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ticket Duration (d:hh:mm:ss) = 
VAR _secsDifTotal = 
DATEDIFF( 
    MIN( 'Table'[Comment date (UTC)] ), 
    MAX( 'Table'[Comment date (UTC)] ), 
    SECOND 
)
VAR _secsPerDay = 24 * 60 * 60
VAR _dayPart = INT( _secsDifTotal / _secsPerDay )
VAR _timePart = MOD( _secsDifTotal, _secsPerDay ) / _secsPerDay
RETURN
_dayPart &amp;amp; ":" &amp;amp; FORMAT( _timePart, "hh:mm:ss" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 23:58:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4633948#M177403</guid>
      <dc:creator>MarkLaf</dc:creator>
      <dc:date>2025-04-01T23:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4637082#M177539</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, does it only calculate the difference between the last and first dates, or does it add up the total time between each date to the same ticket?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 15:54:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4637082#M177539</guid>
      <dc:creator>FelippeAzevedo7</dc:creator>
      <dc:date>2025-04-03T15:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the sum of the time between many updates from the same ticket ID.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4639579#M177638</link>
      <description>&lt;P&gt;It's just getting the difference. If you want to do something like not count the duration for some entries, then it probably makes sense to go the route others suggested re: adding a calculated column to your table that provides the duration using previous ticket row.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 20:38:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-calculate-the-sum-of-the-time-between-many-updates/m-p/4639579#M177638</guid>
      <dc:creator>MarkLaf</dc:creator>
      <dc:date>2025-04-05T20:38:05Z</dc:date>
    </item>
  </channel>
</rss>

