<?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: Getting MAX date from a table with conditions from unrelated table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-MAX-date-from-a-table-with-conditions-from-unrelated/m-p/1563953#M31088</link>
    <description>&lt;P&gt;Assuming you're doing the calculation in context of Table Y then?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, as a new COLUMN in tableY:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TableXDate = MAXX(FILTER(TableX, TableX[Date]&amp;nbsp;&amp;gt;= TableY[Date] -30/1440 &amp;amp;&amp;amp; TableX[Date]&amp;nbsp;&amp;lt;= TableY[Date] + 5/1440), TableX[Date])&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 02:34:52 GMT</pubDate>
    <dc:creator>AllisonKennedy</dc:creator>
    <dc:date>2020-12-22T02:34:52Z</dc:date>
    <item>
      <title>Getting MAX date from a table with conditions from unrelated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-MAX-date-from-a-table-with-conditions-from-unrelated/m-p/1563765#M31079</link>
      <description>&lt;P&gt;New to DAX. Table X has many records let's say for October 1, 2020 with date/time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the MAX date from table X that has a start date&amp;nbsp; &amp;gt;= Table Y -30/1440&amp;nbsp;&lt;U&gt;and&lt;/U&gt; start date &amp;lt;= Table Y + 5/1440.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So table Y also has many records for date/time on October 1, 2020. Tables X and Y are unrelated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table X&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;10/01/2020 12:50:00 AM&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/01/2020 02:27:23 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/01/2020 02:34:37 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/01/2020 03:57:35 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/01/2020 05:20:58 AM&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table Y&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;10/1/20 12:46 AM&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;10/1/20 2:23 AM&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/1/20 2:31 AM&lt;/TD&gt;&lt;TD&gt;10/1/20 3:54 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/1/20 3:54 AM&lt;/TD&gt;&lt;TD&gt;10/1/20 5:17 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/1/20 5:17 AM&lt;/TD&gt;&lt;TD&gt;10/1/20 6:51 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/1/20 6:51 AM&lt;/TD&gt;&lt;TD&gt;10/1/20 8:09 AM&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So Table Y has &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;10/1/20 12:46 AM and&amp;nbsp;10/1/20 2:23 AM (12:46 AM is used for the calculation)&lt;/STRONG&gt;&lt;/FONT&gt;.&amp;nbsp; So the MAX date out of Table X that falls between the red values&amp;nbsp;is&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;10/01/2020 12:50:00 AM.&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;The jist is that for a given date, I want to get the max date out of a range in another (unrelated) table using said given date. I know this is confusing.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Can't figure out a way to do this or if its even possible. Any thoughts?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 00:08:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-MAX-date-from-a-table-with-conditions-from-unrelated/m-p/1563765#M31079</guid>
      <dc:creator>RGallagher320</dc:creator>
      <dc:date>2020-12-22T00:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting MAX date from a table with conditions from unrelated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-MAX-date-from-a-table-with-conditions-from-unrelated/m-p/1563953#M31088</link>
      <description>&lt;P&gt;Assuming you're doing the calculation in context of Table Y then?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, as a new COLUMN in tableY:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TableXDate = MAXX(FILTER(TableX, TableX[Date]&amp;nbsp;&amp;gt;= TableY[Date] -30/1440 &amp;amp;&amp;amp; TableX[Date]&amp;nbsp;&amp;lt;= TableY[Date] + 5/1440), TableX[Date])&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 02:34:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-MAX-date-from-a-table-with-conditions-from-unrelated/m-p/1563953#M31088</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-12-22T02:34:52Z</dc:date>
    </item>
  </channel>
</rss>

