<?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 difference in time between dates in same column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3086089#M107879</link>
    <description>&lt;P&gt;My apologies, the dates should have been in ascending order as in the screenshot below now. There are other rows that I'd rather not show if possible for privacy reasons (ie work related), but the dates should be the column by which the table is sorted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to answer your other question, a calculated column would be the ideal scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help so far!&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>Sat, 18 Feb 2023 12:36:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-02-18T12:36:12Z</dc:date>
    <item>
      <title>Calculate difference in time between dates in same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3085585#M107825</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following column, and I wish to calculate the difference between each row - ie the length of time between Row 2 (20/08/18) and Row 1 (18/01/2017).&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;Any ideas on how to effectively do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 18:43:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3085585#M107825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-17T18:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in time between dates in same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3085838#M107850</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;A href="https://dax.guide/OFFSET/" target="_blank" rel="noopener"&gt;OFFSET&lt;/A&gt;&amp;nbsp;function would work well here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To come up with the exact DAX expression, we would need to clarify:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What determines the sort order? I can see the dates in your image are not in ascending/descending order. Is there another column partitioning or defining the sort order?&lt;/LI&gt;
&lt;LI&gt;Do you want a measure (which would respond to filters) or a calculated column?&lt;BR /&gt;In the case of a measure, we would need to clearly define which dates are included, for example it could be all dates visible in the filter context, or all dates for which certain measure(s) are nonblank.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 01:10:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3085838#M107850</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-02-18T01:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in time between dates in same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3085952#M107869</link>
      <description>&lt;P&gt;hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have other columns?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 06:09:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3085952#M107869</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-18T06:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in time between dates in same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3086089#M107879</link>
      <description>&lt;P&gt;My apologies, the dates should have been in ascending order as in the screenshot below now. There are other rows that I'd rather not show if possible for privacy reasons (ie work related), but the dates should be the column by which the table is sorted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to answer your other question, a calculated column would be the ideal scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help so far!&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>Sat, 18 Feb 2023 12:36:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3086089#M107879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-18T12:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in time between dates in same column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3086118#M107881</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;Days Difference =&lt;BR /&gt;VAR SelectedDates =&lt;BR /&gt;ALLSELECTED ( 'Table'[Date] )&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Table'[Date] ),&lt;BR /&gt;VAR CurrentDate = 'Table'[Date]&lt;BR /&gt;VAR FilteredDates =&lt;BR /&gt;FILTER ( SelectedDates, 'Table'[Date] &amp;lt; CurrentDate )&lt;BR /&gt;VAR PreviousDate =&lt;BR /&gt;MAXX ( FilteredDates, 'Table'[Date] )&lt;BR /&gt;RETURN&lt;BR /&gt;IF ( PreviousDate &amp;lt;&amp;gt; BLANK (), INT ( CurrentDate - PreviousDate ) )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 13:54:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-in-time-between-dates-in-same-column/m-p/3086118#M107881</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-18T13:54:52Z</dc:date>
    </item>
  </channel>
</rss>

