<?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: Time Delta with negative hour handling in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2166918#M50249</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer and for the link to your book, I need it also !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excellent day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Nov 2021 19:24:46 GMT</pubDate>
    <dc:creator>DonPepe</dc:creator>
    <dc:date>2021-11-01T19:24:46Z</dc:date>
    <item>
      <title>Time Delta with negative hour handling</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2163656#M50048</link>
      <description>&lt;P&gt;Good Afternoon,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently looking for a solution to get the duration between two Date-Time value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that I have to handle positivie and negative hour like in these 3 different scenarios :&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;End time &amp;gt; Start time&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;End time &amp;lt; Start time&lt;/LI&gt;&lt;LI&gt;End date &amp;lt;&amp;gt; Start date&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here an exemple of the 3 scenarios.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Activity Type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Start time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End time&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Drive&lt;/TD&gt;&lt;TD&gt;20-10-21 00:06&lt;/TD&gt;&lt;TD&gt;20-10-21 00:11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Time correction&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;20-10-21 01:10&lt;/TD&gt;&lt;TD&gt;20-10-21 00:06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Drive&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;20-10-21 23:06&lt;/TD&gt;&lt;TD&gt;21-10-21 00:22&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how I can have the duration in hh:mm:ss of each activity ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank's in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 17:29:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2163656#M50048</guid>
      <dc:creator>DonPepe</dc:creator>
      <dc:date>2021-10-29T17:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Time Delta with negative hour handling</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2163663#M50050</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="319238" data-lia-user-login="DonPepe" class="lia-mention lia-mention-user"&gt;DonPepe&lt;/a&gt;&amp;nbsp;Just subtract them then turn that into seconds and then you can use Chelsie Eiden's duration.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = ([Start] - [End]) * 1. * 24 * 60 * 60&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389" target="_blank"&gt;Chelsie Eiden's Duration - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 17:36:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2163663#M50050</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-10-29T17:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Time Delta with negative hour handling</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2163714#M50054</link>
      <description>&lt;P&gt;Simple enough to handle it in PQ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcinKLEtV0lEyMtA1NNA1MlQwMLAyMEMTMDRUitWJVgrJzE1VSM4vKkpNLsnMzzu0AEWZoZWhAaZBIH1gO1BVGxlDbTFCqDYyUoqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Activity Type" = _t, #"Start time" = _t, #"End time" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Activity Type", type text}, {"Start time", type datetime}, {"End time", type datetime}}, "fr"),
    Dur = Table.AddColumn(#"Changed Type", "Duration", each let dur = List.Max({[End time]-[Start time], [Start time]-[End time]}) in Text.Format("#{0}h : #{1}m : #{2}s", {Number.RoundDown(Duration.TotalHours(dur)), Duration.Minutes(dur), Duration.Seconds(dur)}))
in
    Dur&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 18:45:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2163714#M50054</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-10-29T18:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Time Delta with negative hour handling</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2166916#M50248</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot, I tried in Power query and it works but I was loking for a DAX solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2166916#M50248</guid>
      <dc:creator>DonPepe</dc:creator>
      <dc:date>2021-11-01T19:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Time Delta with negative hour handling</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2166918#M50249</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer and for the link to your book, I need it also !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excellent day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:24:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Delta-with-negative-hour-handling/m-p/2166918#M50249</guid>
      <dc:creator>DonPepe</dc:creator>
      <dc:date>2021-11-01T19:24:46Z</dc:date>
    </item>
  </channel>
</rss>

