<?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: Return the max date and associated value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205267#M116722</link>
    <description>&lt;P&gt;thanks for this&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;But to clarify the cardshould be the sum of line 1,4 and 8 at the max date which is total of&lt;STRONG&gt; 83,399 &lt;/STRONG&gt;and so if I also had a slicer and selected 2023 for example It will give the max date and return the sum again for the same lines&lt;STRONG&gt;.&lt;/STRONG&gt; I&amp;nbsp;will replicate my scenario using this file and repost it but this helps so that you can understand my context.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 14:25:12 GMT</pubDate>
    <dc:creator>PBIX_COACH</dc:creator>
    <dc:date>2023-04-25T14:25:12Z</dc:date>
    <item>
      <title>Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201306#M116393</link>
      <description>&lt;P&gt;Hi Team I need some help to sum line 1, 4 and 8 respectively however I'm having a hard time doing so without adding the entire line. Essentially I need to&amp;nbsp;grab just the values at the max date (year Qtr header) of the three categories lines and sum them. I have a Dim table for the date that I am using to get the YYYY QQ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 04:07:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201306#M116393</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-23T04:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201316#M116394</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how does your dataset look like?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 05:38:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201316#M116394</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-04-23T05:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201417#M116397</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try something like&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;VAR T1 =&lt;BR /&gt;SUMMARIZE ( 'Table', 'Table'[Category], 'Date'[YearQuarterNumber] )&lt;BR /&gt;VAR T2 =&lt;BR /&gt;TOPN ( 1, T1, 'Date'[YearQuarterNumber] )&lt;BR /&gt;VAR T3 =&lt;BR /&gt;FILTER ( T2, 'Table'[Category] IN { "Line1", "Line4", "Line8" } )&lt;BR /&gt;RETURN&lt;BR /&gt;MAXX ( T3, [Measure] )&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 10:10:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201417#M116397</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-23T10:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201650#M116415</link>
      <description>&lt;P&gt;No dice on this one&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;I think I'm looking for a semi-additive calculation that will end up in a card visual. to add more context, the model is set up as followed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my model set up&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is what I'm trying to achieve. I am using a switch formula to get the respective line item value which is working great. the trouble is I need the create a formula that gives&amp;nbsp;&lt;SPAN&gt;the values at the max date (year Qtr header) based on whatever year I have in my slicer and then have the label line items highlighted summed to compute the valuelisted in the card.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using this formula which works, however, I only get values for year 2022 that have all the values complete however when I change my slicer to 2023 I get a blank result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;LastDate&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;:=&lt;/DIV&gt;&lt;DIV class=""&gt;CALCULATE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mainTbl[value]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;),&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LASTDATE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(&lt;SPAN&gt; mainTbl[date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;)&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;)&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So sorry I cant post the PBIX file but I could really use the help on this on.&lt;/SPAN&gt;&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;</description>
      <pubDate>Sun, 23 Apr 2023 21:24:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3201650#M116415</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-23T21:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203007#M116525</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The only thing that is not clear is the only thing that you did not clarify at all. Why Lines 1, 4 and 8?&lt;/P&gt;
&lt;P&gt;Again I propose the same solution with minor modification&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;LastDate :=
VAR T1 =
    SUMMARIZE ( 'mainTbl', 'sort_table'[Line Item], 'cal_tbl'[YearQuarterNumber] )
VAR T2 =
    TOPN ( 1, T1, 'cal_tbl'[YearQuarterNumber] )
VAR T3 =
    FILTER ( T2, 'sort_table'[Line Item] IN { "Line1", "Line4", "Line8" } )
RETURN
    SUMX( T3, CALCULATE ( SUM ( 'sort_table'[Value] ) ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:39:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203007#M116525</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-24T13:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203031#M116527</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;The reason for line 1,4,and 8 is that these values need to be added together and displayed in a card visual. let me give it a shot and get back to you if it dose not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assist.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:53:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203031#M116527</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-24T13:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203427#M116571</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;result not working and I am getting an incorrect value...I feel like I'm close but I can't seem to get the measure to work so that I can add it to a card visual. The below formula is the closest I have gotten but it only works when I use a table visual with the YearQtr value-added and if I remove it shows blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Measure Max = 
VAR LastDT = MAX('Maintbl'[Date])
Return 
CALCULATE(SUM('Maintbl'[Value]),'Maintbl'[Line_Items] in {"Line1","Line2","Line3,"Line4"},
'Maintbl'[Date]= LastDT
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:06:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203427#M116571</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-24T17:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203444#M116573</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you paste the exact code tgat you have used?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:18:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203444#M116573</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-24T17:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203534#M116584</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;See below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;LastDate2 = 
VAR T1 =
    SUMMARIZE ( 'Maintbl', Sort_tbl[Line_Items], CalendarDim[Year-Q] )
VAR T2 =
    TOPN ( 1, T1, CalendarDim[Year-Q] )
VAR T3 =
    FILTER ( T2, Sort_tbl[Line_Items] IN { "Line1","Line4","Line8" } )
RETURN
    SUMX( T3, CALCULATE ( SUM ( 'Maintbl'[Value] )))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 18:24:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203534#M116584</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-24T18:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203537#M116585</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should be year quarter number (integer data type). But even though it should work at least if you filter one year. Would you plese place it in the table visual and provide a screenshot of the results?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 18:30:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203537#M116585</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-24T18:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203582#M116590</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp; please see below the Measure max is showing the correct value LastDate2 is using the formula you recommended.&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;</description>
      <pubDate>Mon, 24 Apr 2023 19:21:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203582#M116590</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-24T19:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203669#M116597</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just noticed that somehow I changed the MAXX as per my first reply to SUMX by mistake. It should be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LastDate2 =&lt;BR /&gt;VAR T1 =&lt;BR /&gt;SUMMARIZE ( 'Maintbl', Sort_tbl[Line_Items], CalendarDim[Year-Q] )&lt;BR /&gt;VAR T2 =&lt;BR /&gt;TOPN ( 1, T1, CalendarDim[Year-Q] )&lt;BR /&gt;VAR T3 =&lt;BR /&gt;FILTER ( T2, Sort_tbl[Line_Items] IN { "Line1", "Line4", "Line8" } )&lt;BR /&gt;RETURN&lt;BR /&gt;MAXX ( T3, CALCULATE ( SUM ( 'Maintbl'[Value] ) ) )&lt;/P&gt;
&lt;P&gt;however, I still have some concerns; why the value shows at Q1 not Q4 and why it shows 0 for other quarters and whay the total is 0?!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 20:06:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203669#M116597</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-24T20:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203700#M116599</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 0 might be due to no data in Q2-Q4 for 2023. the formula output is still giving me the incorrect result.&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;This is what I see when I change the filter to 2022&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;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 20:17:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3203700#M116599</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-24T20:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3204173#M116636</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I created a sample file and it seems to be working with no issues. Please modify the attached sample file to reflect the actual case and clarify where exactly the problem is and share with me in order to amend if needed.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 04:22:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3204173#M116636</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-25T04:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205267#M116722</link>
      <description>&lt;P&gt;thanks for this&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;But to clarify the cardshould be the sum of line 1,4 and 8 at the max date which is total of&lt;STRONG&gt; 83,399 &lt;/STRONG&gt;and so if I also had a slicer and selected 2023 for example It will give the max date and return the sum again for the same lines&lt;STRONG&gt;.&lt;/STRONG&gt; I&amp;nbsp;will replicate my scenario using this file and repost it but this helps so that you can understand my context.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 14:25:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205267#M116722</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-25T14:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205312#M116728</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="425413" data-lia-user-login="PBIX_COACH" class="lia-mention lia-mention-user"&gt;PBIX_COACH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is not a big issue. Please try&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;LastDate2 = 
VAR T1 =
    SUMMARIZE ( 'Maintbl', Sort_tbl[Line_Items], CalendarDim[Year-Q], "@Value", SUM ( 'Maintbl'[Value] ) )
VAR T2 =
    FILTER ( T1, [@Value] &amp;gt; 0 &amp;amp;&amp;amp; Sort_tbl[Line_Items] IN { "Line 1","Line 4","Line 8" } )
VAR T3 =
    TOPN ( 1, T2, CalendarDim[Year-Q] )
RETURN
    SUMX ( T3, [@Value] )&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 14:46:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205312#M116728</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-25T14:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Return the max date and associated value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205584#M116741</link>
      <description>&lt;P&gt;Bingo! that's it, thanks so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 17:25:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-the-max-date-and-associated-value/m-p/3205584#M116741</guid>
      <dc:creator>PBIX_COACH</dc:creator>
      <dc:date>2023-04-25T17:25:48Z</dc:date>
    </item>
  </channel>
</rss>

