<?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: Showing Last Measure Values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4376187#M173748</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442084" data-lia-user-login="Kate_D" class="lia-mention lia-mention-user"&gt;Kate_D&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification. It seems the requirement is to infer MonthEndDate when a department is missing MonthEndDate. In the Accounting example, it's a simple matter of adding one month to the latest MonthEndDate. In the Construction example, however, the missing MonthEndDate is between two existing MonthEndDate (the logic would have to look for gaps to determine what MonthEndDate to assign). If there were a scenario where a department has two or more rows with missing MonthEndDate, additional logic would be required to determine which row gets assigned which MonthEndDate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The cleanest approach would be to correct the data as far upstream as possible (Power Query, SQL). This will simplify the DAX and optimize performance.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2025 16:56:56 GMT</pubDate>
    <dc:creator>DataInsights</dc:creator>
    <dc:date>2025-01-22T16:56:56Z</dc:date>
    <item>
      <title>Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4365552#M173339</link>
      <description>&lt;P&gt;Hello. I am trying to figure out how to show the last available value returned by measure. For instance, as shown below, there are no Revenue $ values for Accounting and Consulting Departments in December 2024. The Goal % is calculated as measure -&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Goal % =&lt;/SPAN&gt; &lt;SPAN&gt;DIVIDE&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;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Revenue $]&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;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Goal $]&lt;/SPAN&gt;&lt;SPAN&gt;)).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there a way to show the last available Goal % (November 2024 data) for&amp;nbsp;Accounting and Consulting Departments in December 2024 instead on blank values? My struglgle is that Goal % is a calculated measure and not a column. Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 17:13:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4365552#M173339</guid>
      <dc:creator>Kate_D</dc:creator>
      <dc:date>2025-01-15T17:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4365909#M173352</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442084" data-lia-user-login="Kate_D" class="lia-mention lia-mention-user"&gt;Kate_D&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try these measures:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum Revenue = SUM ( Sheet1[Revenue] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sum Goal = SUM ( Sheet1[Goal] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Goal % = 
VAR vCurrentMonthEndDate =
    MAX ( Sheet1[MonthEndDate] )
VAR vLastNonBlankDate =
    CALCULATE (
        LASTNONBLANK ( Sheet1[MonthEndDate], DIVIDE ( [Sum Revenue], [Sum Goal] ) ),
        ALLSELECTED ( Sheet1 ),
        VALUES ( Sheet1[Department] ),
        Sheet1[MonthEndDate] &amp;lt; vCurrentMonthEndDate
    )
VAR vResult =
    IF (
        ISBLANK ( [Sum Revenue] ),
        CALCULATE (
            DIVIDE ( [Sum Revenue], [Sum Goal] ),
            Sheet1[MonthEndDate] = vLastNonBlankDate
        ),
        DIVIDE ( [Sum Revenue], [Sum Goal] )
    )
RETURN
    vResult&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;</description>
      <pubDate>Wed, 15 Jan 2025 23:45:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4365909#M173352</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2025-01-15T23:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4374389#M173685</link>
      <description>&lt;P&gt;Thank you for your assisstance. Is there a solution when there are no MonthEndDate values for some departments? Like 11/30/2024 and 12/30/2024 but we still want to show last avalable Goal % for&amp;nbsp;11/30/2024 and 12/30/2024 when using date filter?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 20:56:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4374389#M173685</guid>
      <dc:creator>Kate_D</dc:creator>
      <dc:date>2025-01-21T20:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4374486#M173690</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442084" data-lia-user-login="Kate_D" class="lia-mention lia-mention-user"&gt;Kate_D&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you provide an example and the expected result? It's generally better to resolve data issues in Power Query. How would departments without MonthEndDate be selected via the date slicer?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 22:49:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4374486#M173690</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2025-01-21T22:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4375974#M173736</link>
      <description>&lt;P&gt;Let's say there was no Revenue $ or date recorded for Accounting department for 12/31/24, no&amp;nbsp;Revenue $ or date for Construction department for 11/30/24, and no Revenue $ for 12/31/2024.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 15:04:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4375974#M173736</guid>
      <dc:creator>Kate_D</dc:creator>
      <dc:date>2025-01-22T15:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4376006#M173738</link>
      <description>&lt;P&gt;However, when filtering the data for 11/30/2024, we still want to show Sum of Revenue, Goal % and MonthEndDate for Construction which would be data for a previous period of 10/31/2024 where the solution your provided above would work. For instance, the last data for Construction department was posted for 10/31/2024. When running a report for all departments for 1/31/25, there is no data for construction, but we still would like to show the last avaialble data which was&amp;nbsp;for 10/31/2024.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 15:21:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4376006#M173738</guid>
      <dc:creator>Kate_D</dc:creator>
      <dc:date>2025-01-22T15:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Last Measure Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4376187#M173748</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442084" data-lia-user-login="Kate_D" class="lia-mention lia-mention-user"&gt;Kate_D&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification. It seems the requirement is to infer MonthEndDate when a department is missing MonthEndDate. In the Accounting example, it's a simple matter of adding one month to the latest MonthEndDate. In the Construction example, however, the missing MonthEndDate is between two existing MonthEndDate (the logic would have to look for gaps to determine what MonthEndDate to assign). If there were a scenario where a department has two or more rows with missing MonthEndDate, additional logic would be required to determine which row gets assigned which MonthEndDate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The cleanest approach would be to correct the data as far upstream as possible (Power Query, SQL). This will simplify the DAX and optimize performance.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 16:56:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Last-Measure-Values/m-p/4376187#M173748</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2025-01-22T16:56:56Z</dc:date>
    </item>
  </channel>
</rss>

