<?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: Calculated column - two values, only return the last value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323449#M171644</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've updated the file with a bit more dummy data. I only included 1 example Cust No when I should have added more. In this case, because Customer No HUW227 is the latest posting date (05/12/2024), then that value is returned in the column. My expected output would be...&lt;BR /&gt;&lt;BR /&gt;For ABC01 Cust No, return HUW227, for GEO02 Cust No, return HUW221&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 09:27:38 GMT</pubDate>
    <dc:creator>Tob_P</dc:creator>
    <dc:date>2024-12-11T09:27:38Z</dc:date>
    <item>
      <title>Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4321798#M171572</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to created a calculated column to return the last value in the Cust No column based on the lastest posting date. So in the example you can access through the link, the new column would return only HUW227.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help with this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1j3QxtftIiuOLfmAecxKMmnjXUisw4DBo/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1j3QxtftIiuOLfmAecxKMmnjXUisw4DBo/view?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 13:27:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4321798#M171572</guid>
      <dc:creator>Tob_P</dc:creator>
      <dc:date>2024-12-10T13:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4321981#M171582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="399872" data-lia-user-login="Tob_P" class="lia-mention lia-mention-user"&gt;Tob_P&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;latestcust=&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sales&lt;/SPAN&gt;&lt;SPAN&gt;[Cust No]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sales&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Sales&lt;/SPAN&gt;&lt;SPAN&gt;[Posting Date]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sales&lt;/SPAN&gt;&lt;SPAN&gt;[Posting Date]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Dec 2024 14:56:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4321981#M171582</guid>
      <dc:creator>powerbiexpert22</dc:creator>
      <dc:date>2024-12-10T14:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4322008#M171584</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the response - doesn't quite get me what I am looking for unfortunately. It returns the last Cust No listed in the table based on the posting date eg. GEO02 is the last Cust No as there on sales on 10/12/2024 therefore the calculated column returns GEO02. I probanly should have stated that there will be hundreds of Cust Nos&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 15:03:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4322008#M171584</guid>
      <dc:creator>Tob_P</dc:creator>
      <dc:date>2024-12-10T15:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4322166#M171592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="399872" data-lia-user-login="Tob_P" class="lia-mention lia-mention-user"&gt;Tob_P&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I do not see customer&amp;nbsp;&lt;SPAN&gt;GEO02 in your dataset, can you please share what is the expected output with some sample data?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 16:34:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4322166#M171592</guid>
      <dc:creator>powerbiexpert22</dc:creator>
      <dc:date>2024-12-10T16:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323449#M171644</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've updated the file with a bit more dummy data. I only included 1 example Cust No when I should have added more. In this case, because Customer No HUW227 is the latest posting date (05/12/2024), then that value is returned in the column. My expected output would be...&lt;BR /&gt;&lt;BR /&gt;For ABC01 Cust No, return HUW227, for GEO02 Cust No, return HUW221&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 09:27:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323449#M171644</guid>
      <dc:creator>Tob_P</dc:creator>
      <dc:date>2024-12-11T09:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323630#M171652</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="399872" data-lia-user-login="Tob_P" class="lia-mention lia-mention-user"&gt;Tob_P&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the relationship or business rule between&amp;nbsp;&lt;SPAN&gt;ABC01&amp;nbsp; and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;HUW227&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Similary,&amp;nbsp;What is the relationship or business rule between GEO02&amp;nbsp;and HUW221&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 10:54:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323630#M171652</guid>
      <dc:creator>powerbiexpert22</dc:creator>
      <dc:date>2024-12-11T10:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323643#M171654</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408509" data-lia-user-login="powerbiexpert22" class="lia-mention lia-mention-user"&gt;powerbiexpert22&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;A Cust No can change. To maintain reporting on a Customer, a Reporting Cust No is created to retain the original Cust No. For the purposes of this task, I need to be able to output the last Cust No based on the most recent Posting Date&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 10:58:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4323643#M171654</guid>
      <dc:creator>Tob_P</dc:creator>
      <dc:date>2024-12-11T10:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4324316#M171682</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="399872" data-lia-user-login="Tob_P" class="lia-mention lia-mention-user"&gt;Tob_P&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I am not sure what you are looking sorry, you can try to utilize SUMMARIZE () in DAX based on your need&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 16:35:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4324316#M171682</guid>
      <dc:creator>powerbiexpert22</dc:creator>
      <dc:date>2024-12-11T16:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4327045#M171781</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="399872" data-lia-user-login="Tob_P" class="lia-mention lia-mention-user"&gt;Tob_P&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&amp;nbsp;powerbiexpert22&amp;nbsp;for your prompt reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LastCustNo = 
VAR LatestDate = 
    CALCULATE(
        MAX('Sales'[Posting Date]),
        ALLEXCEPT('Sales', 'Sales'[Reporting Cust No])
    )
RETURN 
CALCULATE(
    MAX('Sales'[Cust No]),
    FILTER(
        'Sales',
        'Sales'[Posting Date] = LatestDate &amp;amp;&amp;amp;
        'Sales'[Reporting Cust No] = EARLIER('Sales'[Reporting Cust No])
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the 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;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 02:37:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4327045#M171781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-13T02:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column - two values, only return the last value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4327742#M171802</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;Perfect - works a treat for me so thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 10:00:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-two-values-only-return-the-last-value/m-p/4327742#M171802</guid>
      <dc:creator>Tob_P</dc:creator>
      <dc:date>2024-12-13T10:00:24Z</dc:date>
    </item>
  </channel>
</rss>

