<?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 Difference between 2 times in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2939028#M96990</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to find the difference between 2 time in separate rows like this table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;i want the result to be like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 13:39:30 GMT</pubDate>
    <dc:creator>orobbsh</dc:creator>
    <dc:date>2022-11-30T13:39:30Z</dc:date>
    <item>
      <title>Difference between 2 times</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2939028#M96990</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to find the difference between 2 time in separate rows like this table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;i want the result to be like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:39:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2939028#M96990</guid>
      <dc:creator>orobbsh</dc:creator>
      <dc:date>2022-11-30T13:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between 2 times</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2939212#M97012</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479601" data-lia-user-login="orobbsh" class="lia-mention lia-mention-user"&gt;orobbsh&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I do not know if it feasible in your situation but if you delete the first cell of start (8:00 AM) and that you shift all cells in the start column 1 cell up, you would only need to create a new column calculating the difference between start and end to have the time difference without jugling with different lines.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 14:39:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2939212#M97012</guid>
      <dc:creator>philouduv</dc:creator>
      <dc:date>2022-11-30T14:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between 2 times</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2940732#M97110</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479601" data-lia-user-login="orobbsh" class="lia-mention lia-mention-user"&gt;orobbsh&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this method:&lt;/P&gt;
&lt;P&gt;Create two columns:&lt;/P&gt;
&lt;DIV&gt;var =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( 'Table'[end] ),&lt;BR /&gt;FILTER ( 'Table', 'Table'[surgery id] = EARLIER ( 'Table'[surgery id] ) - 1 ))&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;difference = MINUTE('Table'[start] - 'Table'[var])&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;New tables:&lt;/DIV&gt;
&lt;DIV&gt;Result =&lt;BR /&gt;TOPN (&lt;BR /&gt;4,&lt;BR /&gt;SELECTCOLUMNS (&lt;BR /&gt;'Table',&lt;BR /&gt;"Surgery",&lt;BR /&gt;IF (&lt;BR /&gt;'Table'[surgery id] &amp;lt;= 3,&lt;BR /&gt;"S" &amp;amp; 'Table'[surgery id],&lt;BR /&gt;IF ( 'Table'[surgery id] = 5, "S4" )&lt;BR /&gt;),&lt;BR /&gt;"start time", 'Table'[start],&lt;BR /&gt;"end time",&lt;BR /&gt;IF (&lt;BR /&gt;'Table'[surgery id] &amp;lt; 3,&lt;BR /&gt;[end],&lt;BR /&gt;IF (&lt;BR /&gt;'Table'[surgery id] = 3&lt;BR /&gt;|| 'Table'[surgery id] = 4,&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( 'Table'[end] ),&lt;BR /&gt;FILTER ( 'Table', 'Table'[surgery id] = 3 || 'Table'[surgery id] = 4 )&lt;BR /&gt;),&lt;BR /&gt;TIME ( 12, 0, 0 )&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;"time difference", 'Table'[difference]&lt;BR /&gt;),&lt;BR /&gt;[Surgery], DESC&lt;BR /&gt;)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;The result is:&lt;/DIV&gt;
&lt;DIV&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps you.&lt;/P&gt;
&lt;P&gt;Here is my PBIX file.&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 _Yinliw&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Dec 2022 05:34:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-2-times/m-p/2940732#M97110</guid>
      <dc:creator>v-yinliw-msft</dc:creator>
      <dc:date>2022-12-01T05:34:12Z</dc:date>
    </item>
  </channel>
</rss>

