<?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 Days Between in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3044183#M104588</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to the following measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;STAND_BY_DAYS = var _lastarea=MAXX(FILTER(ALLSELECTED('Table'),[EQUIPMENT]=MAX([EQUIPMENT])&amp;amp;&amp;amp;[AREA]&amp;lt;MAX([AREA])),[AREA])
var _lastenddate=MAXX(FILTER(ALLSELECTED('Table'),[AREA]=_lastarea&amp;amp;&amp;amp;[EQUIPMENT]=MAX([EQUIPMENT])),[END_DATE])
var _currentstartdate=MINX(FILTER(ALLSELECTED('Table'),[AREA]=MAX([AREA])&amp;amp;&amp;amp;[EQUIPMENT]=MAX([EQUIPMENT])),[START_DATE])
return IF(MAX('Table'[START_DATE])=_currentstartdate,DATEDIFF(_lastenddate,_currentstartdate,DAY))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Yolo Zhu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 03:14:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-26T03:14:14Z</dc:date>
    <item>
      <title>Calculate Days Between</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3041193#M104321</link>
      <description>&lt;P&gt;I am trying to count the day difference between the End Date on one Area compared to the Start Date of the next Area by Equipment based on a slicer selection for the Equipment being assigned to the Area. My current measure is calculating both pieces of equipment as one. How do I modify the measure to group by Equipment? My desired result is residing n the STAND_BY_DAYS column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STAND_BY_DAYS = datediff(minx(ALLSELECTED(Table),Table[START_DATE]),maxx(ALLSELECTED(Table),Table[END_DATE]),DAY)-SUMX(ALLSELECTED(Table),Table[DAYS])&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;Thanks for the Help.&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>Tue, 24 Jan 2023 19:15:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3041193#M104321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-24T19:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Days Between</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3041640#M104360</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , A new column &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diff =&lt;/P&gt;
&lt;P&gt;var _max = maxx(filter(Table, [equipment] = earlier([equipment]) &amp;amp;&amp;amp; [END_DATE] &amp;lt; earlier([END_DATE])&lt;BR /&gt;&amp;amp;&amp;amp; [Area] &amp;lt;&amp;gt; earlier([Area]) ) , [END_DATE])&lt;BR /&gt;var _min = Minx(filter(Table, [equipment] = earlier([equipment]) &amp;amp;&amp;amp; [Area] = earlier([Area]) ) , [JOB])&lt;BR /&gt;return&lt;/P&gt;
&lt;P&gt;Switch( True() ,&lt;BR /&gt;_min = [JOB] &amp;amp;&amp;amp; isblank(_max) , Blank() ,&lt;BR /&gt;_min = [JOB] , datediff(_min, [Start_date], day) ,&lt;BR /&gt;blank())&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 02:31:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3041640#M104360</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-25T02:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Days Between</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3041694#M104362</link>
      <description>&lt;P&gt;hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Is the first 6 coulmns your sample data?&lt;/P&gt;&lt;P&gt;2) what context fo you have for the expected measure?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 03:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3041694#M104362</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-01-25T03:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Days Between</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3044183#M104588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to the following measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;STAND_BY_DAYS = var _lastarea=MAXX(FILTER(ALLSELECTED('Table'),[EQUIPMENT]=MAX([EQUIPMENT])&amp;amp;&amp;amp;[AREA]&amp;lt;MAX([AREA])),[AREA])
var _lastenddate=MAXX(FILTER(ALLSELECTED('Table'),[AREA]=_lastarea&amp;amp;&amp;amp;[EQUIPMENT]=MAX([EQUIPMENT])),[END_DATE])
var _currentstartdate=MINX(FILTER(ALLSELECTED('Table'),[AREA]=MAX([AREA])&amp;amp;&amp;amp;[EQUIPMENT]=MAX([EQUIPMENT])),[START_DATE])
return IF(MAX('Table'[START_DATE])=_currentstartdate,DATEDIFF(_lastenddate,_currentstartdate,DAY))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Yolo Zhu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 03:14:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3044183#M104588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-26T03:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Days Between</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3045506#M104654</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Yolo.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How about a measure to referance the STAND_BY_DAYS and divide by the job count per area and distibute to the jobs accordingly?&lt;/SPAN&gt;&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;</description>
      <pubDate>Thu, 26 Jan 2023 15:28:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Days-Between/m-p/3045506#M104654</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-26T15:28:06Z</dc:date>
    </item>
  </channel>
</rss>

