<?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: DAX Measure to subtract dates in different rows by group in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-subtract-dates-in-different-rows-by-group/m-p/3125953#M111029</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;LI-CODE lang="markup"&gt;Expected result days: =
VAR _current =
    MAX ( Data[DateTime] )
VAR _previous =
    CALCULATE (
        MAX ( Data[DateTime] ),
        OFFSET (
            -1,
            ALL ( Data[Squad], Data[DateTime] ),
            ORDERBY ( Data[DateTime], ASC ),
            KEEP,
            PARTITIONBY ( Data[Squad] )
        )
    )
RETURN
    IF (
        HASONEVALUE ( Data[Squad] ),
        DATEDIFF ( _previous, _current, MINUTE ) / ( 24 * 60 )
    )
&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 12 Mar 2023 07:05:52 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-03-12T07:05:52Z</dc:date>
    <item>
      <title>DAX Measure to subtract dates in different rows by group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-subtract-dates-in-different-rows-by-group/m-p/3124253#M110922</link>
      <description>&lt;P&gt;Database sample:&lt;BR /&gt;&lt;BR /&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;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need a &lt;U&gt;DAX Measure&lt;/U&gt; (since I'll work with FILTERED VALUES) to calculate the difference between consecutive dates &lt;U&gt;by&amp;nbsp;Squad&lt;/U&gt;.&lt;BR /&gt;&lt;BR /&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;BR /&gt;Thank you in advance (=&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 14:19:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-subtract-dates-in-different-rows-by-group/m-p/3124253#M110922</guid>
      <dc:creator>leodm</dc:creator>
      <dc:date>2023-03-10T14:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to subtract dates in different rows by group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-subtract-dates-in-different-rows-by-group/m-p/3125953#M111029</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;LI-CODE lang="markup"&gt;Expected result days: =
VAR _current =
    MAX ( Data[DateTime] )
VAR _previous =
    CALCULATE (
        MAX ( Data[DateTime] ),
        OFFSET (
            -1,
            ALL ( Data[Squad], Data[DateTime] ),
            ORDERBY ( Data[DateTime], ASC ),
            KEEP,
            PARTITIONBY ( Data[Squad] )
        )
    )
RETURN
    IF (
        HASONEVALUE ( Data[Squad] ),
        DATEDIFF ( _previous, _current, MINUTE ) / ( 24 * 60 )
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 12 Mar 2023 07:05:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-subtract-dates-in-different-rows-by-group/m-p/3125953#M111029</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-03-12T07:05:52Z</dc:date>
    </item>
  </channel>
</rss>

