<?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 with max() function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129559#M187366</link>
    <description>&lt;P&gt;just tested my assumption. created a side table with only week numbers from data table. made a max() function on week number and used in calculation and it works fine. simply you cant have calculation and parameter defined from the same table.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2026 22:10:45 GMT</pubDate>
    <dc:creator>mglitta</dc:creator>
    <dc:date>2026-03-10T22:10:45Z</dc:date>
    <item>
      <title>calculate with max() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129431#M187359</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I try to do simple calc where instead of fixed value i want to use function (max)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;formula with fixed value works&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;REV_CW =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;REV_CW&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'LOAD'&lt;/SPAN&gt;&lt;SPAN&gt;[REVENUE_ACT]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;'LOAD'&lt;/SPAN&gt;&lt;SPAN&gt;[TYPE]&lt;/SPAN&gt; &lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; { &lt;/SPAN&gt;&lt;SPAN&gt;"LOAD"&lt;/SPAN&gt;&lt;SPAN&gt; } &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;'LOAD'&lt;/SPAN&gt;&lt;SPAN&gt;[WEEK]&lt;/SPAN&gt; &lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;11&lt;/SPAN&gt;&lt;SPAN&gt;})&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;REV_CW&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;when i replace fixed value with function max(), it returns all rows, but total shows correctly&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;REV_CW =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;REV_CW&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'LOAD'&lt;/SPAN&gt;&lt;SPAN&gt;[REVENUE_ACT]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;'LOAD'&lt;/SPAN&gt;&lt;SPAN&gt;[TYPE]&lt;/SPAN&gt; &lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; { &lt;/SPAN&gt;&lt;SPAN&gt;"LOAD"&lt;/SPAN&gt;&lt;SPAN&gt; } &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;'LOAD'&lt;/SPAN&gt;&lt;SPAN&gt;[WEEK]&lt;/SPAN&gt; &lt;SPAN&gt;IN&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;LOAD&lt;/SPAN&gt;&lt;SPAN&gt;[WEEK]&lt;/SPAN&gt;&lt;SPAN&gt;) })&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;REV_CW&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Mar 2026 17:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129431#M187359</guid>
      <dc:creator>mglitta</dc:creator>
      <dc:date>2026-03-10T17:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: calculate with max() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129539#M187364</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1562517" data-lia-user-login="mglitta" class="lia-mention lia-mention-user"&gt;mglitta&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try a few things?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check if Max(load[week]) actually returns 11, inside your table visual?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also perhaps change your code to :&lt;BR /&gt;"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;REV_CW =
VAR MAXWEEK = MAX(LOAD[WEEK]) 
VAR REV_CW = CALCULATE(SUM('LOAD'[REVENUE_ACT]), 'LOAD'[TYPE] IN { "LOAD" } &amp;amp;&amp;amp; 'LOAD'[WEEK] = MAXWEEK, 'LOAD'[WEEK] &amp;lt;&amp;gt; BLANK()
RETURN
REV_CW&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 21:16:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129539#M187364</guid>
      <dc:creator>Demert</dc:creator>
      <dc:date>2026-03-10T21:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: calculate with max() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129558#M187365</link>
      <description>&lt;P&gt;thanks Demert for your advice, I tried and it didnt help.&lt;/P&gt;&lt;P&gt;yes, &lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;SPAN&gt;[WEEK]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; returns value 11, i test the formula in a card.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;i suspect that the problem might be that i calculate revenue in the same table where i define the parameter from. I have to figure out the other way how to define week number parameter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 21:59:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129558#M187365</guid>
      <dc:creator>mglitta</dc:creator>
      <dc:date>2026-03-10T21:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: calculate with max() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129559#M187366</link>
      <description>&lt;P&gt;just tested my assumption. created a side table with only week numbers from data table. made a max() function on week number and used in calculation and it works fine. simply you cant have calculation and parameter defined from the same table.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 22:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129559#M187366</guid>
      <dc:creator>mglitta</dc:creator>
      <dc:date>2026-03-10T22:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: calculate with max() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129688#M187369</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1562517" data-lia-user-login="mglitta" class="lia-mention lia-mention-user"&gt;mglitta&lt;/a&gt;,&lt;BR /&gt;Thanks for the update and for sharing the solution.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;It’s good to hear that using a separate table for the week parameter resolved the issue. This will assist other community members in resolving similar issues more efficiently.&lt;BR /&gt;Also thanks to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="534080" data-lia-user-login="Demert" class="lia-mention lia-mention-user"&gt;Demert&lt;/a&gt;&amp;nbsp;for the earlier suggestions.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ganesh Singamshetty.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2026 04:48:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-with-max-function/m-p/5129688#M187369</guid>
      <dc:creator>v-ssriganesh</dc:creator>
      <dc:date>2026-03-11T04:48:53Z</dc:date>
    </item>
  </channel>
</rss>

