<?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 time difference between two timstamp columns in direct query mode in PowerBI in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2739684#M84142</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353281" data-lia-user-login="yjk3140" class="lia-mention lia-mention-user"&gt;yjk3140&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please try below steps.&lt;/P&gt;
&lt;P&gt;1.in power query pane, change the data type to "Date/Time/Timezone"&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. add a new column with below dax formula&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Hourly Diff =
DATEDIFF ( 'Table'[Time stamp2], 'Table'[Time stamp 1], SECOND ) / 3600
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Binbin Yu&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2022 05:50:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-01T05:50:15Z</dc:date>
    <item>
      <title>calculate time difference between two timstamp columns in direct query mode in PowerBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2733612#M83787</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I need to calculate the time difference between two timestamp columns in my table and create a new column with the calculated values but as I'm doing this in the direct query mode, I have some limitations for it. I tried datediff, duration.totalseconds etc but nothing really worked..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;the result I want is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I got this result using the sql below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select (unix_timestamp(timestamp1)-unix_timestamp(timestamp2))/3600 as hourly_diff from azure_anomaly_detection_pilot.ops_log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 22:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2733612#M83787</guid>
      <dc:creator>yjk3140</dc:creator>
      <dc:date>2022-08-29T22:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: calculate time difference between two timstamp columns in direct query mode in PowerBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2734220#M83822</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353281" data-lia-user-login="yjk3140" class="lia-mention lia-mention-user"&gt;yjk3140&lt;/a&gt; , try if this measure can help &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sumx(Table, Table[Timestamp1], Table[timestamp2], second)&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 06:39:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2734220#M83822</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-08-30T06:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: calculate time difference between two timstamp columns in direct query mode in PowerBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2735151#M83871</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;, I tried this but I'm getting an syntax error for this solution.&lt;/P&gt;&lt;P&gt;I think the correct syntax for sumx is sumx(table, expression)&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 11:54:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2735151#M83871</guid>
      <dc:creator>yjk3140</dc:creator>
      <dc:date>2022-08-30T11:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: calculate time difference between two timstamp columns in direct query mode in PowerBI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2739684#M84142</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353281" data-lia-user-login="yjk3140" class="lia-mention lia-mention-user"&gt;yjk3140&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please try below steps.&lt;/P&gt;
&lt;P&gt;1.in power query pane, change the data type to "Date/Time/Timezone"&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. add a new column with below dax formula&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Hourly Diff =
DATEDIFF ( 'Table'[Time stamp2], 'Table'[Time stamp 1], SECOND ) / 3600
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Binbin Yu&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 05:50:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-time-difference-between-two-timstamp-columns-in-direct/m-p/2739684#M84142</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-01T05:50:15Z</dc:date>
    </item>
  </channel>
</rss>

