<?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 DAX getting MIN value from rows with same value in different column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4403655#M174803</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Feel silly asking as this seems like it should be simple.&lt;BR /&gt;&lt;BR /&gt;Looking to create a new column for a table that contains the Min 'Start Date' value for rows that have the same InitialResultID.&lt;BR /&gt;IE just dealing with one table and two cols within it.&lt;BR /&gt;&lt;BR /&gt;Things that I've tried:&lt;BR /&gt;&amp;nbsp;CALCULATE(MIN(table[Start Date]), FILTER(table, TestBillingAgentTasks[InitialResultID])&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(table&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;TestBillingAgentTasks&lt;/SPAN&gt;&lt;SPAN&gt;[InitialResultID]&lt;/SPAN&gt;&lt;SPAN&gt;=table&lt;/SPAN&gt;&lt;SPAN&gt;[InitialResultID]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;More, how do you effectively reference a current row value instead of using scalar for comparative expressions like what is used in the filter fuction?&lt;BR /&gt;I find this easier to do / find in the manual for all of Excel, Pandas, SQL...&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2025 20:21:45 GMT</pubDate>
    <dc:creator>TuqueLogic</dc:creator>
    <dc:date>2025-02-10T20:21:45Z</dc:date>
    <item>
      <title>DAX getting MIN value from rows with same value in different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4403655#M174803</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Feel silly asking as this seems like it should be simple.&lt;BR /&gt;&lt;BR /&gt;Looking to create a new column for a table that contains the Min 'Start Date' value for rows that have the same InitialResultID.&lt;BR /&gt;IE just dealing with one table and two cols within it.&lt;BR /&gt;&lt;BR /&gt;Things that I've tried:&lt;BR /&gt;&amp;nbsp;CALCULATE(MIN(table[Start Date]), FILTER(table, TestBillingAgentTasks[InitialResultID])&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(table&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;TestBillingAgentTasks&lt;/SPAN&gt;&lt;SPAN&gt;[InitialResultID]&lt;/SPAN&gt;&lt;SPAN&gt;=table&lt;/SPAN&gt;&lt;SPAN&gt;[InitialResultID]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;More, how do you effectively reference a current row value instead of using scalar for comparative expressions like what is used in the filter fuction?&lt;BR /&gt;I find this easier to do / find in the manual for all of Excel, Pandas, SQL...&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 20:21:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4403655#M174803</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-10T20:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX getting MIN value from rows with same value in different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4403679#M174806</link>
      <description>&lt;P&gt;&lt;SPAN&gt;EARLIER seems to do it:&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;[StartDate]&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(table&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestBillingAgentTasks&lt;/SPAN&gt;&lt;SPAN&gt;[InitialResultID]&lt;/SPAN&gt;&lt;SPAN&gt;=EARLIER(table&lt;/SPAN&gt;&lt;SPAN&gt;[InitialResultID]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;BR /&gt;&lt;BR /&gt;Here it states EARLIER refersto the previous 'table scan':&lt;BR /&gt;&lt;A href="https://dax.guide/earlier/" target="_blank"&gt;EARLIER - DAX Guide&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Can someone point me to where I can understand better what table scans are, where in the code they are initiated, and by which types of functions?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 20:44:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4403679#M174806</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-10T20:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: DAX getting MIN value from rows with same value in different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4404058#M174833</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A table scan examines each record in a table row by row to determine if they meet the specified conditions. There are two types of functions that trigger a table scan: filtering functions, such as&amp;nbsp;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;, and iteration functions, such as&amp;nbsp;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;. The initiation of a table scan is related to these functions, occurring when these functions are called and during the calculation of row context.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I also created simple example data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;TestBillingAgentTasks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create two calculated columns, the former is used to get the same ID and the latter calculates the minimum date:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SameValue = LOOKUPVALUE('TestBillingAgentTasks'[InitialResultID],'TestBillingAgentTasks'[InitialResultID],'table'[InitialResultID])
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;MinValue = IF('table'[SameValue]&amp;lt;&amp;gt;0,CALCULATE(MIN('table'[Start Date]),FILTER('table','table'[SameValue]=EARLIER('table'[InitialResultID]))))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is a relationship between the two tables, the following formula can also be used:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MinDate = CALCULATE(MIN('table (2)'[Start Date]),FILTER(ALLEXCEPT('table (2)','table (2)'[InitialResultID]),'table (2)'[InitialResultID]=RELATED('TestBillingAgentTasks（2）'[InitialResultID])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/I&gt;, then please consider&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/I&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 03:00:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-getting-MIN-value-from-rows-with-same-value-in-different/m-p/4404058#M174833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-11T03:00:27Z</dc:date>
    </item>
  </channel>
</rss>

