<?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: Duration Since Previous TimeStamp by Person and Category Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2744104#M84473</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;thanks for your reply. Do you know how to do this as a measure only without creating new columns?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2022 16:49:07 GMT</pubDate>
    <dc:creator>itsme</dc:creator>
    <dc:date>2022-09-02T16:49:07Z</dc:date>
    <item>
      <title>Duration Since Previous TimeStamp by Person and Category Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2741763#M84292</link>
      <description>&lt;P&gt;I need a measure that will give me the duration since the previous timestamp for a particular person and category in the dataset. Below, I have a sample of the dataset. If it's the first timestamp for the given category and person, the duration should be blank or 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figured it out using a calculated column for "Last TimeStamp", but I would prefer to only use measures as this dataset will have about 1M rows and I don't want more columns.&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>Thu, 01 Sep 2022 21:59:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2741763#M84292</guid>
      <dc:creator>itsme</dc:creator>
      <dc:date>2022-09-01T21:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Duration Since Previous TimeStamp by Person and Category Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2742172#M84312</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="18096" data-lia-user-login="itsme" class="lia-mention lia-mention-user"&gt;itsme&lt;/a&gt; , Try a new column &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New column = &lt;BR /&gt;var _maxx(filter(Table, [Name] = earlier([Name]) &amp;amp;&amp;amp; [Category] =earlier([Category]) &amp;amp;&amp;amp; [datetimestamp] &amp;lt; earlier([datetimestamp])), [datetimestamp])&lt;BR /&gt;return &lt;BR /&gt;[datetimestamp] -_max&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 03:29:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2742172#M84312</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-02T03:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Duration Since Previous TimeStamp by Person and Category Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2744104#M84473</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;thanks for your reply. Do you know how to do this as a measure only without creating new columns?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 16:49:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2744104#M84473</guid>
      <dc:creator>itsme</dc:creator>
      <dc:date>2022-09-02T16:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Duration Since Previous TimeStamp by Person and Category Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2749106#M84767</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="18096" data-lia-user-login="itsme" class="lia-mention lia-mention-user"&gt;itsme&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;According to your description, you want to group according to [name] and [category], find the duration of previous timestamp, and you want to use measure to realize. Right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here are the steps you can follow：&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(1)This is my test data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(2)We can create a measure: “Duration”:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Duration =
VAR _cuurent_name =
    SELECTEDVALUE ( 'Test'[Name] )
VAR _current_category =
    SELECTEDVALUE ( 'Test'[Category] )
VAR _current_datetime =
    SELECTEDVALUE ( 'Test'[DateTimeStamp] )
VAR _pre_date =
    MAXX (
        FILTER (
            ALL ( 'Test' ),
            'Test'[Name] = _cuurent_name
                &amp;amp;&amp;amp; 'Test'[Category] = _current_category
                &amp;amp;&amp;amp; 'Test'[DateTimeStamp] &amp;lt; _current_datetime
        ),
        [DateTimeStamp]
    )
VAR _duration =
    VALUE ( _current_datetime - _pre_date )
RETURN
    IF (
        _pre_date = BLANK (),
        BLANK (),
        TRUNC ( _duration ) &amp;amp; ":"
            &amp;amp; FORMAT ( _duration, "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;SPAN&gt;(3)We put the measure [Duration] and other fields we need in the table, then we can meet your need:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this method can't meet your requirement, can you share some specific input and output sample data?We can better understand the problem and help you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://m365x67151090-my.sharepoint.com/:u:/g/personal/aniyazhang_m365x67151090_onmicrosoft_com/ET1oreo2VCNDuGZwquNwDb8BMcK55gnIpHJBUyZQSURrKA?e=kznEfc" target="_self"&gt;Duration_Test.pbix&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://m365x67151090-my.sharepoint.com/:u:/g/personal/aniyazhang_m365x67151090_onmicrosoft_com/ET1oreo2VCNDuGZwquNwDb8BMcK55gnIpHJBUyZQSURrKA?e=kznEfc" target="_self"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://m365x67151090-my.sharepoint.com/:u:/g/personal/aniyazhang_m365x67151090_onmicrosoft_com/ET1oreo2VCNDuGZwquNwDb8BMcK55gnIpHJBUyZQSURrKA?e=kznEfc" target="_self"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://m365x67151090-my.sharepoint.com/:u:/g/personal/aniyazhang_m365x67151090_onmicrosoft_com/ET1oreo2VCNDuGZwquNwDb8BMcK55gnIpHJBUyZQSURrKA?e=kznEfc" target="_self"&gt;&lt;SPAN&gt;Aniya Zhang&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://m365x67151090-my.sharepoint.com/:u:/g/personal/aniyazhang_m365x67151090_onmicrosoft_com/ET1oreo2VCNDuGZwquNwDb8BMcK55gnIpHJBUyZQSURrKA?e=kznEfc" target="_self"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps, then please consider&amp;nbsp;&lt;I&gt;Accept it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/I&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 03:59:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2749106#M84767</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-09-06T03:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Duration Since Previous TimeStamp by Person and Category Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2753962#M85058</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;, this does work!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 22:48:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Duration-Since-Previous-TimeStamp-by-Person-and-Category-Measure/m-p/2753962#M85058</guid>
      <dc:creator>itsme</dc:creator>
      <dc:date>2022-09-07T22:48:26Z</dc:date>
    </item>
  </channel>
</rss>

