<?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: How to get the latest amount filter by year and month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301982#M123210</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376088" data-lia-user-login="NickzNickz" class="lia-mention lia-mention-user"&gt;NickzNickz&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More like this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Mesure = 
    CALCULATE(
        SUM( 'Table'[Migration] ),
        'Table'[Date] = MAX( 'Table'[Date] )
    )&lt;/LI-CODE&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;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 08:56:26 GMT</pubDate>
    <dc:creator>Alf94</dc:creator>
    <dc:date>2023-06-26T08:56:26Z</dc:date>
    <item>
      <title>How to get the latest amount filter by year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301730#M123188</link>
      <description>&lt;P&gt;Hi...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created the table below for our scenario purposes.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and below is the measure I currently have to get the output but only get the latest last record ...&lt;BR /&gt;Filter by Year and Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Latest Value Migration = 
VAR _Year = MAX(test_scenario_2[Year])
VAR _Month = MAX(test_scenario_2[Month])
VAR _Maxdate = MAXX(FILTER(test_scenario_2, test_scenario_2[Year] = _Year), test_scenario_2[Month] = _Month)
VAR _Result = MAXX(FILTER(test_scenario_2, test_scenario_2[Year] = _Year &amp;amp;&amp;amp; test_scenario_2[Month] = _Month) , test_scenario_2[Migration])
Return
IF(ISBLANK(_Result),"0.00",_Result)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone can help me to get the below result :&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; Migration total sum for the latest year and month. The result should get = 1950&lt;/P&gt;&lt;P&gt;2) Please advise me if the measure can be a more simplified version or the table need an additional column...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;NickzNickz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 06:54:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301730#M123188</guid>
      <dc:creator>NickzNickz</dc:creator>
      <dc:date>2023-06-26T06:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest amount filter by year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301795#M123193</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376088" data-lia-user-login="NickzNickz" class="lia-mention lia-mention-user"&gt;NickzNickz&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Latest value migration =
VAR _year = MAX(test_scenario_2[Year])
VAR _month = MAX(test_scenario_2[Month])
RETURN
    SUMX(
        FILTER(
            test_scenario_2,
            test_scenario_2[Year] = _year &amp;amp;&amp;amp; test_scenario_2[Month] = _month
        ),
        test_scenario_2[Migration]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I answered your question, please mark my post as a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:29:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301795#M123193</guid>
      <dc:creator>Alf94</dc:creator>
      <dc:date>2023-06-26T07:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest amount filter by year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301818#M123197</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460119" data-lia-user-login="Alf94" class="lia-mention lia-mention-user"&gt;Alf94&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tested ...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Scenario 1 - ok ..&amp;nbsp;&lt;BR /&gt;Scenario 2&amp;nbsp; - I add year 2023 and month 3 , result is empty as below ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Should I create date table and filter max from there ? ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NickzNickz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:47:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301818#M123197</guid>
      <dc:creator>NickzNickz</dc:creator>
      <dc:date>2023-06-26T07:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest amount filter by year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301834#M123198</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376088" data-lia-user-login="NickzNickz" class="lia-mention lia-mention-user"&gt;NickzNickz&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A date table would certainly be a good idea &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Once created, you could simply sum the migration column, filtered on MAX( dateTable[Date] ).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:52:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301834#M123198</guid>
      <dc:creator>Alf94</dc:creator>
      <dc:date>2023-06-26T07:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest amount filter by year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301891#M123203</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460119" data-lia-user-login="Alf94" class="lia-mention lia-mention-user"&gt;Alf94&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created date table as per your recommendation and below is the result.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Latest Value Migration 3 = 
    SUMX(
        FILTER(
            test_scenario_2,test_scenario_2[Date] 
            = MAX(test_scenario_2[Date])
        ),
        test_scenario_2[Migration])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I want to get only the last value, what should I change in the measure ? ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NickzNickz&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 08:14:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301891#M123203</guid>
      <dc:creator>NickzNickz</dc:creator>
      <dc:date>2023-06-26T08:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest amount filter by year and month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301982#M123210</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="376088" data-lia-user-login="NickzNickz" class="lia-mention lia-mention-user"&gt;NickzNickz&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More like this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Mesure = 
    CALCULATE(
        SUM( 'Table'[Migration] ),
        'Table'[Date] = MAX( 'Table'[Date] )
    )&lt;/LI-CODE&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;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 08:56:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-latest-amount-filter-by-year-and-month/m-p/3301982#M123210</guid>
      <dc:creator>Alf94</dc:creator>
      <dc:date>2023-06-26T08:56:26Z</dc:date>
    </item>
  </channel>
</rss>

