<?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 Maximum value in dynamic date range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261962#M54721</link>
    <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It might sound simple, but I have been looking this solution up for quite a long time, almost everywhere on the internet, unsuccesfully, so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need something "dynamic", let's say, in the sense that I need to have the max value in the last 3 days, in the context of every row. Just like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;calculate(max(Table[value]), filter(all(Table), Table[date] &amp;gt;= max(Table[date]) -3))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;calculate(max(Table[value]), filter(all(Table), Table[value] = max(Table[value]) &amp;amp;&amp;amp; Table[date] &amp;gt;= max(Table[date]) -3))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;None of the two solutions shown above are working for me.&lt;/P&gt;&lt;P&gt;The first one is giving "25" for every row. The second one is giving blank for every row.&lt;/P&gt;&lt;P&gt;I am writting the DAX formulas on Power Pivot, but I guess that's not the reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks to everyone.&lt;/P&gt;</description>
    <pubDate>Fri, 31 Dec 2021 08:13:09 GMT</pubDate>
    <dc:creator>zolotrip</dc:creator>
    <dc:date>2021-12-31T08:13:09Z</dc:date>
    <item>
      <title>Maximum value in dynamic date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261962#M54721</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It might sound simple, but I have been looking this solution up for quite a long time, almost everywhere on the internet, unsuccesfully, so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need something "dynamic", let's say, in the sense that I need to have the max value in the last 3 days, in the context of every row. Just like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;calculate(max(Table[value]), filter(all(Table), Table[date] &amp;gt;= max(Table[date]) -3))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;calculate(max(Table[value]), filter(all(Table), Table[value] = max(Table[value]) &amp;amp;&amp;amp; Table[date] &amp;gt;= max(Table[date]) -3))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;None of the two solutions shown above are working for me.&lt;/P&gt;&lt;P&gt;The first one is giving "25" for every row. The second one is giving blank for every row.&lt;/P&gt;&lt;P&gt;I am writting the DAX formulas on Power Pivot, but I guess that's not the reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks to everyone.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 08:13:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261962#M54721</guid>
      <dc:creator>zolotrip</dc:creator>
      <dc:date>2021-12-31T08:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value in dynamic date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261964#M54722</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="348654" data-lia-user-login="zolotrip" class="lia-mention lia-mention-user"&gt;zolotrip&lt;/a&gt; , Please find code for new column and measure &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new column = &lt;BR /&gt;maxx(filter(Table, Table[date] &amp;gt;= earlier(Table[Date]) -3 &amp;amp;&amp;amp; Table[date] &amp;lt;= earlier(Table[date])),[Table[value])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;new measure = &lt;BR /&gt;maxx(filter(allselected(Table), Table[date] &amp;gt;= max(Table[Date]) -3 &amp;amp;&amp;amp; Table[date] &amp;lt;= max(Table[date])),[Table[value])&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 08:21:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261964#M54722</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-12-31T08:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value in dynamic date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261968#M54723</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;This pattern ought to do what you want:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MaxLast3 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;Cdate&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'calendar'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt; &lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MaxLast[Value]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'MaxLast'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;DATESBETWEEN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'calendar'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Cdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Cdate&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Test data:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;End result:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 Dec 2021 08:30:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261968#M54723</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2021-12-31T08:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value in dynamic date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261986#M54724</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN&gt;&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;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your quick response.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;It's working perfectly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 09:23:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2261986#M54724</guid>
      <dc:creator>zolotrip</dc:creator>
      <dc:date>2021-12-31T09:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value in dynamic date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2262002#M54727</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have available the SELECTEDVAUE expression in Power Pivot, I'm afraid.&lt;/P&gt;&lt;P&gt;Do you know an equivalent to it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 09:34:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2262002#M54727</guid>
      <dc:creator>zolotrip</dc:creator>
      <dc:date>2021-12-31T09:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value in dynamic date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2262028#M54730</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You can either use MAX it often works in a similar way or this pattern:&amp;nbsp;&lt;SPAN&gt;IF(HASONEVALUE([column]), VALUES([column]), [alternateresult]).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 10:53:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Maximum-value-in-dynamic-date-range/m-p/2262028#M54730</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2021-12-31T10:53:35Z</dc:date>
    </item>
  </channel>
</rss>

