<?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 Struggling with MAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2774231#M86516</link>
    <description>&lt;P&gt;I apologize in advance for the length of this post but the background is necessary to fully frame the problem I’m having.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am analyzing a data file containing monthly forecasted costs updated after actual costs are posted on a monthly basis.&amp;nbsp; The data file (“All Forecasts”) contains a version number field that contains a system-generated unique identifier ('Forecast Version Number') for each monthly version of the forecast:&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;The analysis I’m trying to do compares the current forecast (extracted from “All Forecasts” into a calculated table based on the “current” value in the ‘Forecast Version Type’ column) with the last forecast.&amp;nbsp; I create another calculated table called ‘Historic Forecasts’ by extracting all the values from “All Forecasts” that don’t say “current” in the ‘Forecast Version Type’ column.&amp;nbsp; I then want to subtract the last forecast from the current forecast to calculate how much the forecast changed from last month.&amp;nbsp; My logic is that the highest forecast version number in the ‘Historic Forecast’ table is the last forecast.&amp;nbsp; This seems to work fine as long as none of the previous forecast versions have forecasted costs in more months than the current forecast version.&amp;nbsp; See the table below:&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;The ‘Last Forecast’ column calculates the last forecast using the following formula:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;Last Forecast =&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;VAR MaxVersionNo = MAX('Historic Forecast Table'[No])&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;RETURN&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;CALCULATE( SUM('Historic Forecast Table'[Forecast]),&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; FILTER('Historic Forecast Table', 'Historic Forecast Table'[No]=MaxVersionNo)&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where ‘Historic Forecast Table’[No] = Forecast Version Number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ‘Remaining Last Forecast’ column calculates the forecasts for the months after that last date of actuals from the previous period.&amp;nbsp; For example, if the current forecast was created in September and includes the forecasted costs for September on, the ‘Remaining Last Forecast’ would show what the monthly forecasted costs were for August moving forward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you’ll see is the Current Forecast (‘Actuals and Forecast’) stops when the actuals stop.&amp;nbsp; This is because there are no forecasted costs beyond May in the Current Forecast (Version 6).&amp;nbsp; The problem is, there were also no forecasted costs beyond May in the Last Forecast (Version 5).&amp;nbsp; However, there were forecasted costs beyond May in Version 4, which is what is showing up in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is my problem.&amp;nbsp; It seems like my MAX formula in the [Last Forecast] measure is not calculating the global max version; it seems to be looking at each date in the ‘Forecast Period – Year Month’ column (in the first table), calculating the MAX Version No for each month, and then returning the forecasted value associated with that MAX Version No.&amp;nbsp; I only want it to return a value associated with the global max, i.e. Version 5.&amp;nbsp; Therefore, if Version 4 has a forecast value in June but Version 5 does not, the measure should return nothing for June.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sticking through to the end and I appreciate any advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 17:36:29 GMT</pubDate>
    <dc:creator>ecfrench</dc:creator>
    <dc:date>2022-09-16T17:36:29Z</dc:date>
    <item>
      <title>Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2774231#M86516</link>
      <description>&lt;P&gt;I apologize in advance for the length of this post but the background is necessary to fully frame the problem I’m having.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am analyzing a data file containing monthly forecasted costs updated after actual costs are posted on a monthly basis.&amp;nbsp; The data file (“All Forecasts”) contains a version number field that contains a system-generated unique identifier ('Forecast Version Number') for each monthly version of the forecast:&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;The analysis I’m trying to do compares the current forecast (extracted from “All Forecasts” into a calculated table based on the “current” value in the ‘Forecast Version Type’ column) with the last forecast.&amp;nbsp; I create another calculated table called ‘Historic Forecasts’ by extracting all the values from “All Forecasts” that don’t say “current” in the ‘Forecast Version Type’ column.&amp;nbsp; I then want to subtract the last forecast from the current forecast to calculate how much the forecast changed from last month.&amp;nbsp; My logic is that the highest forecast version number in the ‘Historic Forecast’ table is the last forecast.&amp;nbsp; This seems to work fine as long as none of the previous forecast versions have forecasted costs in more months than the current forecast version.&amp;nbsp; See the table below:&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;The ‘Last Forecast’ column calculates the last forecast using the following formula:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;Last Forecast =&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;VAR MaxVersionNo = MAX('Historic Forecast Table'[No])&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;RETURN&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;CALCULATE( SUM('Historic Forecast Table'[Forecast]),&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; FILTER('Historic Forecast Table', 'Historic Forecast Table'[No]=MaxVersionNo)&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where ‘Historic Forecast Table’[No] = Forecast Version Number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ‘Remaining Last Forecast’ column calculates the forecasts for the months after that last date of actuals from the previous period.&amp;nbsp; For example, if the current forecast was created in September and includes the forecasted costs for September on, the ‘Remaining Last Forecast’ would show what the monthly forecasted costs were for August moving forward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you’ll see is the Current Forecast (‘Actuals and Forecast’) stops when the actuals stop.&amp;nbsp; This is because there are no forecasted costs beyond May in the Current Forecast (Version 6).&amp;nbsp; The problem is, there were also no forecasted costs beyond May in the Last Forecast (Version 5).&amp;nbsp; However, there were forecasted costs beyond May in Version 4, which is what is showing up in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is my problem.&amp;nbsp; It seems like my MAX formula in the [Last Forecast] measure is not calculating the global max version; it seems to be looking at each date in the ‘Forecast Period – Year Month’ column (in the first table), calculating the MAX Version No for each month, and then returning the forecasted value associated with that MAX Version No.&amp;nbsp; I only want it to return a value associated with the global max, i.e. Version 5.&amp;nbsp; Therefore, if Version 4 has a forecast value in June but Version 5 does not, the measure should return nothing for June.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sticking through to the end and I appreciate any advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 17:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2774231#M86516</guid>
      <dc:creator>ecfrench</dc:creator>
      <dc:date>2022-09-16T17:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2774705#M87122</link>
      <description>&lt;P&gt;I apologize in advance for the length of this post but the background is necessary to fully frame the problem I’m having.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am analyzing a data file containing monthly forecasted costs updated after actual costs are posted on a monthly basis.&amp;nbsp; The data file (“All Forecasts”) contains a version number field that contains a system-generated unique identifier (Forecast Version Number) for each monthly version of the forecast:&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;The analysis I’m trying to do compares the current forecast (extracted from “All Forecasts” into a calculated table based on the “current” value in the ‘Forecast Version Type’ column) with the last forecast.&amp;nbsp; I create another calculated table called ‘Historic Forecasts’ by extracting all the values from “All Forecasts” that don’t say “current” in the ‘Forecast Version Type’ column.&amp;nbsp; I then want to subtract the last forecast from the current forecast to calculate how much the forecast changed from last month.&amp;nbsp; My logic is that the highest forecast version number in the ‘Historic Forecast’ table is the last forecast.&amp;nbsp; This seems to work fine as long as none of the previous forecast versions have forecasted costs in more months than the current forecast version.&amp;nbsp; See the table below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The ‘Last Forecast’ column calculates the last forecast using the following formula:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;Last Forecast =&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;VAR &lt;FONT color="#33CCCC"&gt;MaxVersionNo&lt;/FONT&gt; = MAX('Historic Forecast Table'[No])&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;RETURN&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;CALCULATE( SUM('Historic Forecast Table'[Forecast]),&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp; FILTER('Historic Forecast Table', 'Historic Forecast Table'[No]=&lt;FONT color="#33CCCC"&gt;MaxVersionNo&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Where ‘Historic Forecast Table’[No] = Forecast Version Number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ‘Remaining Last Forecast’ column calculates the forecasts for the months after that last date of actuals from the previous period.&amp;nbsp; For example, if the current forecast was created in September and includes the forecasted costs for September on, the ‘Remaining Last Forecast’ would show what the monthly forecasted costs were for August moving forward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you’ll see is the Current Forecast (‘Actuals and Forecast’) stops when the actuals stop.&amp;nbsp; This is because there are no forecasted costs beyond May in the Current Forecast (Version 6).&amp;nbsp; The problem is, there were also no forecasted costs beyond May in the Last Forecast (Version 5).&amp;nbsp; However, there were forecasted costs beyond May in Version 4, which is what is showing up in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is my problem.&amp;nbsp; It seems like my MAX formula in the [Last Forecast] measure is not calculating the global max version; it seems to be looking at each date in the ‘Forecast Period – Year Month’ column (in the first table), calculating the MAX Version No for each month, and then returning the forecasted value associated with that MAX Version No.&amp;nbsp; I only want it to return a value associated with the global max, i.e. Version 5.&amp;nbsp; Therefore, if Version 4 has a forecast value in June but Version 5 does not, the measure should return nothing for June.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sticking through to the end and I appreciate any advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 23:06:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2774705#M87122</guid>
      <dc:creator>ecfrench</dc:creator>
      <dc:date>2022-09-16T23:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2775065#M87123</link>
      <description>&lt;P&gt;Read about context transition and filter modifiers. Most likely your filter context is restricted to the "current row".&lt;/P&gt;
&lt;P&gt;A single ALLSELECTED() placed into your CALCULATE formula may already be sufficient.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 15:15:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2775065#M87123</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-09-17T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2778185#M87124</link>
      <description>&lt;P&gt;Thanks for the reply &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;.&amp;nbsp; I had already tried putting ALL or ALLSELECTED both before the FILTER function and after in the CALCULATE function but the result was no different.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:59:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2778185#M87124</guid>
      <dc:creator>ecfrench</dc:creator>
      <dc:date>2022-09-19T15:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2778190#M87125</link>
      <description>&lt;P&gt;Please provide sanitized sample data that fully covers your issue. &lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 16:01:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2778190#M87125</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-09-19T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2779175#M86916</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321915" data-lia-user-login="ecfrench" class="lia-mention lia-mention-user"&gt;ecfrench&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to get the global maximum version number. Right?&lt;/P&gt;
&lt;P&gt;The defined variable "VAR MaxVersionNo = MAX('Historic Forecast Table'[No])" in your metric is calculated in the current filter context.&lt;/P&gt;
&lt;P&gt;You can try to this dax&amp;nbsp;to get the maximum No of the entire table :&lt;/P&gt;
&lt;P&gt;VAR MaxVersionNo = MAXX(ALL('Historic Forecast Table'[No]),'Historic Forecast Table'[No])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 02:43:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2779175#M86916</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-09-20T02:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2787532#M87422</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;&amp;nbsp;I tried what you suggested but it returned nothing in the last forecast column(s) of the second table.&amp;nbsp; I think it did that because it truly looked at the global max forecast version in the table, which was the highest version for all projects (something like 13 I think).&amp;nbsp; I think what I need to do is ignore the date filter context but not the project filter context.&amp;nbsp; I want to get the max forecast version for the subject project, not the max forecast version for all the projects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a sanitized .pbix file and will upload it when I can.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 16:51:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2787532#M87422</guid>
      <dc:creator>ecfrench</dc:creator>
      <dc:date>2022-09-22T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2788912#M87501</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321915" data-lia-user-login="ecfrench" class="lia-mention lia-mention-user"&gt;ecfrench&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to calculate the max version number&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;for the subject project, not the max forecast version for all the projects.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try to this dax&amp;nbsp;to get the maximum No of the subject project :&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(MAX('Historic Forecast Table'[No]),ALL('Historic Forecast Table'),VALUES([ProjectNumber]))&lt;/LI-CODE&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;desired output sample&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;data in the form of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 07:38:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2788912#M87501</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-09-23T07:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with MAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2800881#M88111</link>
      <description>&lt;P&gt;That worked.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 19:44:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Struggling-with-MAX/m-p/2800881#M88111</guid>
      <dc:creator>ecfrench</dc:creator>
      <dc:date>2022-09-27T19:44:45Z</dc:date>
    </item>
  </channel>
</rss>

