<?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: sequence of calculate &amp;quot;max&amp;quot; in aggregation of a &amp;quot;running sum&amp;quot; in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3976434#M154179</link>
    <description>&lt;P&gt;Thank you Jihwan_Kim.&lt;/P&gt;&lt;P&gt;I tried your query, but the result is running sum of (MeasureA+MeasureB).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2024 08:02:48 GMT</pubDate>
    <dc:creator>elke_hh</dc:creator>
    <dc:date>2024-06-06T08:02:48Z</dc:date>
    <item>
      <title>sequence of calculate "max" in aggregation of a "running sum"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3975001#M154132</link>
      <description>&lt;P&gt;Hello Forum,&lt;/P&gt;&lt;P&gt;I have following problem when trying to calculate a "running sum" over a measure which determines a maximum value out of two measures.&lt;/P&gt;&lt;P&gt;The issue is, that I cannot force the determination of the max-value before it comes to the calculation of the sum. The determination of max-Value is correct on its own but in the aggregation of running-sum it looks as if first sum is caculatet and then max-Value.&lt;/P&gt;&lt;P&gt;My query looks like this:&lt;/P&gt;&lt;P&gt;RunningSum_ofMAX =&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; RunningSum =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;max&lt;/SPAN&gt;&lt;SPAN&gt;([MeasureA], [MeasureB]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt; ( D_DATETABLE ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; D_DATETABLE[Calendar Day] &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; ( D_DATETABLE[Calendar Day] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; RunningSum&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;MeasureA and MeasureB are simple calculations:&lt;/SPAN&gt;&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;sum&lt;/SPAN&gt;&lt;SPAN&gt;(Table[Quantity]),D_DATETABLE[ROLLING 12 M],&lt;/SPAN&gt;&lt;SPAN&gt;Filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(D_MEASURE),D_MEASURE[MEASURE_ID] = 1&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It would be great, to get a hint&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks Elke&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jun 2024 16:41:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3975001#M154132</guid>
      <dc:creator>elke_hh</dc:creator>
      <dc:date>2024-06-05T16:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: sequence of calculate "max" in aggregation of a "running sum"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3975034#M154133</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but please try something like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RunningSum_ofMAX =
VAR RunningSum =
    SUMX (
        FILTER (
            ALL ( D_DATETABLE ),
            D_DATETABLE[Calendar Day] &amp;lt;= MAX ( D_DATETABLE[Calendar Day] )
        ),
        CALCULATE ( MAX ( [MeasureA], [MeasureB] ) )
    )
RETURN
    RunningSum
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 Jun 2024 17:08:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3975034#M154133</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-06-05T17:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: sequence of calculate "max" in aggregation of a "running sum"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3976434#M154179</link>
      <description>&lt;P&gt;Thank you Jihwan_Kim.&lt;/P&gt;&lt;P&gt;I tried your query, but the result is running sum of (MeasureA+MeasureB).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 08:02:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3976434#M154179</guid>
      <dc:creator>elke_hh</dc:creator>
      <dc:date>2024-06-06T08:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: sequence of calculate "max" in aggregation of a "running sum"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3976876#M154192</link>
      <description>&lt;P&gt;I will resolve my issue as follows:&lt;BR /&gt;The measure is used in datecontext "Year-Month" and "Year-Week".&lt;BR /&gt;For this I will use a tablefunction with max values of&amp;nbsp;&lt;SPAN&gt;[MeasureA] and [MeasureB] for each "Year-Month" (same for "Year-Week)&amp;nbsp;&lt;/SPAN&gt;. This max-Value can be summed up with sumx iteratly in the running sum.&lt;BR /&gt;Not the generic solution I would prefer but no longer worth time to spend on&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 11:08:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sequence-of-calculate-quot-max-quot-in-aggregation-of-a-quot/m-p/3976876#M154192</guid>
      <dc:creator>elke_hh</dc:creator>
      <dc:date>2024-06-06T11:08:02Z</dc:date>
    </item>
  </channel>
</rss>

