<?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: Use latest date available if selected date doesn't have data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4860951#M185418</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284387" data-lia-user-login="elmurat" class="lia-mention lia-mention-user"&gt;elmurat&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i understand you right , first make sure your&amp;nbsp;slicers is single-select and make the measure fall back to the latest date on or before the selection for the current LoanID.&lt;BR /&gt;First :&amp;nbsp;Read the slicers&lt;BR /&gt;Selected Year-End Date =MAX ( YearEnd[YearEndDate] )&lt;/P&gt;&lt;P&gt;Selected Month-End Date =MAX ( MonthEnd[MonthEndDate] )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2nd: “Last available date ≤ selection” (keeps LoanID filter)&lt;BR /&gt;Last Available Year-End Date =&lt;BR /&gt;VAR sel = [Selected Year-End Date]&lt;BR /&gt;VAR dWithinOrBeforeSel =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( YearEnd[YearEndDate] ),&lt;BR /&gt;ALL ( YearEnd[YearEndDate] ),&lt;BR /&gt;YearEnd[YearEndDate] &amp;lt;= sel&lt;BR /&gt;)&lt;BR /&gt;VAR dFallbackOverallMax =&lt;BR /&gt;CALCULATE ( MAX ( YearEnd[YearEndDate] ), ALL ( YearEnd[YearEndDate] ) )&lt;BR /&gt;RETURN COALESCE ( dWithinOrBeforeSel, dFallbackOverallMax )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Last Available Month-End Date =&lt;BR /&gt;VAR sel = [Selected Month-End Date]&lt;BR /&gt;VAR dWithinOrBeforeSel =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( MonthEnd[MonthEndDate] ),&lt;BR /&gt;ALL ( MonthEnd[MonthEndDate] ),&lt;BR /&gt;MonthEnd[MonthEndDate] &amp;lt;= sel&lt;BR /&gt;)&lt;BR /&gt;VAR dFallbackOverallMax =&lt;BR /&gt;CALCULATE ( MAX ( MonthEnd[MonthEndDate] ), ALL ( MonthEnd[MonthEndDate] ) )&lt;BR /&gt;RETURN COALESCE ( dWithinOrBeforeSel, dFallbackOverallMax )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3rd&amp;nbsp;: Principal “as-of” each side&lt;BR /&gt;Principal @ Year-End (as-of) =&lt;BR /&gt;VAR d = [Last Available Year-End Date]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( YearEnd[Principal] ),&lt;BR /&gt;KEEPFILTERS ( YearEnd[YearEndDate] = d )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Principal @ Month-End (as-of) =&lt;BR /&gt;VAR d = [Last Available Month-End Date]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( MonthEnd[Principal] ),&lt;BR /&gt;KEEPFILTERS ( MonthEnd[MonthEndDate] = d )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;4th: Final difference&lt;BR /&gt;Principal Diff (MonthEnd – YearEnd) =&lt;BR /&gt;VAR m = [Principal @ Month-End (as-of)]&lt;BR /&gt;VAR y = [Principal @ Year-End (as-of)]&lt;BR /&gt;RETURN IF ( NOT ISBLANK(m) &amp;amp;&amp;amp; NOT ISBLANK(y), m - y )&lt;BR /&gt;&lt;BR /&gt;Same&amp;nbsp;idea mentioned in this problem :&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Power-Query/Find-Most-Recent-Date-Relative-to-another-Date-Column-in-Power/m-p/4790379" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/Power-Query/Find-Most-Recent-Date-Relative-to-another-Date-Column-in-Power/m-p/4790379&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If this helps please mark my answer as &lt;STRONG&gt;Solution&lt;/STRONG&gt; and drop a &lt;STRONG&gt;Kudos&lt;/STRONG&gt; &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Oct 2025 18:48:26 GMT</pubDate>
    <dc:creator>Aala_Ali</dc:creator>
    <dc:date>2025-10-29T18:48:26Z</dc:date>
    <item>
      <title>Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4860900#M185417</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two datasets:&lt;/P&gt;&lt;P&gt;1. Year End&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;Month End&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My report has two Date Dropdown filters, Year End and Month End.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation should display the difference in Principal for a loan ID for the selected Month-End and Year-End.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If for the selected Month End Date there is no data available, choose the latest available date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in the report, for example for the Loan2, is user selects 1/3/2025 for Year End and 9/30/2025 for Month End,&lt;/P&gt;&lt;P&gt;the principle should show 200. Because 1200-1000.&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;Any idea how to tackle this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate any help you can provide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 17:53:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4860900#M185417</guid>
      <dc:creator>elmurat</dc:creator>
      <dc:date>2025-10-28T17:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4860951#M185418</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284387" data-lia-user-login="elmurat" class="lia-mention lia-mention-user"&gt;elmurat&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i understand you right , first make sure your&amp;nbsp;slicers is single-select and make the measure fall back to the latest date on or before the selection for the current LoanID.&lt;BR /&gt;First :&amp;nbsp;Read the slicers&lt;BR /&gt;Selected Year-End Date =MAX ( YearEnd[YearEndDate] )&lt;/P&gt;&lt;P&gt;Selected Month-End Date =MAX ( MonthEnd[MonthEndDate] )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2nd: “Last available date ≤ selection” (keeps LoanID filter)&lt;BR /&gt;Last Available Year-End Date =&lt;BR /&gt;VAR sel = [Selected Year-End Date]&lt;BR /&gt;VAR dWithinOrBeforeSel =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( YearEnd[YearEndDate] ),&lt;BR /&gt;ALL ( YearEnd[YearEndDate] ),&lt;BR /&gt;YearEnd[YearEndDate] &amp;lt;= sel&lt;BR /&gt;)&lt;BR /&gt;VAR dFallbackOverallMax =&lt;BR /&gt;CALCULATE ( MAX ( YearEnd[YearEndDate] ), ALL ( YearEnd[YearEndDate] ) )&lt;BR /&gt;RETURN COALESCE ( dWithinOrBeforeSel, dFallbackOverallMax )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Last Available Month-End Date =&lt;BR /&gt;VAR sel = [Selected Month-End Date]&lt;BR /&gt;VAR dWithinOrBeforeSel =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( MonthEnd[MonthEndDate] ),&lt;BR /&gt;ALL ( MonthEnd[MonthEndDate] ),&lt;BR /&gt;MonthEnd[MonthEndDate] &amp;lt;= sel&lt;BR /&gt;)&lt;BR /&gt;VAR dFallbackOverallMax =&lt;BR /&gt;CALCULATE ( MAX ( MonthEnd[MonthEndDate] ), ALL ( MonthEnd[MonthEndDate] ) )&lt;BR /&gt;RETURN COALESCE ( dWithinOrBeforeSel, dFallbackOverallMax )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3rd&amp;nbsp;: Principal “as-of” each side&lt;BR /&gt;Principal @ Year-End (as-of) =&lt;BR /&gt;VAR d = [Last Available Year-End Date]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( YearEnd[Principal] ),&lt;BR /&gt;KEEPFILTERS ( YearEnd[YearEndDate] = d )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Principal @ Month-End (as-of) =&lt;BR /&gt;VAR d = [Last Available Month-End Date]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( MonthEnd[Principal] ),&lt;BR /&gt;KEEPFILTERS ( MonthEnd[MonthEndDate] = d )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;4th: Final difference&lt;BR /&gt;Principal Diff (MonthEnd – YearEnd) =&lt;BR /&gt;VAR m = [Principal @ Month-End (as-of)]&lt;BR /&gt;VAR y = [Principal @ Year-End (as-of)]&lt;BR /&gt;RETURN IF ( NOT ISBLANK(m) &amp;amp;&amp;amp; NOT ISBLANK(y), m - y )&lt;BR /&gt;&lt;BR /&gt;Same&amp;nbsp;idea mentioned in this problem :&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Power-Query/Find-Most-Recent-Date-Relative-to-another-Date-Column-in-Power/m-p/4790379" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/Power-Query/Find-Most-Recent-Date-Relative-to-another-Date-Column-in-Power/m-p/4790379&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If this helps please mark my answer as &lt;STRONG&gt;Solution&lt;/STRONG&gt; and drop a &lt;STRONG&gt;Kudos&lt;/STRONG&gt; &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 18:48:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4860951#M185418</guid>
      <dc:creator>Aala_Ali</dc:creator>
      <dc:date>2025-10-29T18:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4861858#M185450</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284387" data-lia-user-login="elmurat" class="lia-mention lia-mention-user"&gt;elmurat&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I hope the link and my answer help address your question. Let me know if you encounter any issues.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 18:51:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4861858#M185450</guid>
      <dc:creator>Aala_Ali</dc:creator>
      <dc:date>2025-10-29T18:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4862771#M185479</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284387" data-lia-user-login="elmurat" class="lia-mention lia-mention-user"&gt;elmurat&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="877908" data-lia-user-login="Aala_Ali" class="lia-mention lia-mention-user"&gt;Aala_Ali&lt;/a&gt;&amp;nbsp;for the prompt response.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As we haven’t heard back from you, we wanted to kindly follow up to&amp;nbsp;check if the solution provided by the user for the issue worked?&amp;nbsp;or let us know if you need any further assistance.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;Anjan Kumar Chippa&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 19:12:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4862771#M185479</guid>
      <dc:creator>v-achippa</dc:creator>
      <dc:date>2025-10-30T19:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4865023#M185540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/284387" target="_blank"&gt;@elmurat&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We wanted to kindly follow up to&amp;nbsp;check if the solution provided by the user for the issue worked?&amp;nbsp;or let us know if you need any further assistance.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;Anjan Kumar Chippa&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 12:20:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4865023#M185540</guid>
      <dc:creator>v-achippa</dc:creator>
      <dc:date>2025-11-03T12:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4865389#M185552</link>
      <description>&lt;P&gt;Thank you very much, Aala. Your solution helped me a lot.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 19:22:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4865389#M185552</guid>
      <dc:creator>elmurat</dc:creator>
      <dc:date>2025-11-03T19:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Use latest date available if selected date doesn't have data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4865793#M185561</link>
      <description>&lt;P&gt;Happy for helping , Welcome.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 08:58:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-latest-date-available-if-selected-date-doesn-t-have-data/m-p/4865793#M185561</guid>
      <dc:creator>Aala_Ali</dc:creator>
      <dc:date>2025-11-04T08:58:00Z</dc:date>
    </item>
  </channel>
</rss>

