<?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 Colum: Get MIN value from a filtered table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220060#M52663</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="309136" data-lia-user-login="derekmalag" class="lia-mention lia-mention-user"&gt;derekmalag&lt;/a&gt;&amp;nbsp;Here are a couple different ways:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MIN_VALUE = 
CALCULATE (
     MIN('MyTable'[Total_Value]),
     FILTER('MyTable',[Model]=EARLIER('MyTable'[Model]))
)

MIN_VALUE = 
  VAR __Model = [Model]
RETURN
  CALCULATE (
     MIN('MyTable'[Total_Value]),
     FILTER('MyTable',[Model]=__Model)
  )

&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 03 Dec 2021 13:37:58 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2021-12-03T13:37:58Z</dc:date>
    <item>
      <title>Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220017#M52657</link>
      <description>&lt;P&gt;Hi, I'm stuck in something that I think it is simple but I can't make it work so I'm pretty sure I'm doing something incorrectly but don;t know what so would appreciatte any light on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Table with two columns and I want to create a calculated column that get the Min value of the Model. The expected output is&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Model&lt;/TD&gt;&lt;TD&gt;Total_Value&lt;/TD&gt;&lt;TD&gt;MIN_VALUE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;3 *&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2*&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;7*&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've tried the following DAX query for the calculated column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MIN_VALUE = CALCULATE (
     MIN('MyTable'[Total_Value]),
     FILTER('MyTable',[Model]=[Model])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;However, what I get is the minimum value of the table without being filtered (2 for all values).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any help on what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 12:58:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220017#M52657</guid>
      <dc:creator>derekmalag</dc:creator>
      <dc:date>2021-12-03T12:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220060#M52663</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="309136" data-lia-user-login="derekmalag" class="lia-mention lia-mention-user"&gt;derekmalag&lt;/a&gt;&amp;nbsp;Here are a couple different ways:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MIN_VALUE = 
CALCULATE (
     MIN('MyTable'[Total_Value]),
     FILTER('MyTable',[Model]=EARLIER('MyTable'[Model]))
)

MIN_VALUE = 
  VAR __Model = [Model]
RETURN
  CALCULATE (
     MIN('MyTable'[Total_Value]),
     FILTER('MyTable',[Model]=__Model)
  )

&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 Dec 2021 13:37:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220060#M52663</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-12-03T13:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220078#M52667</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;did I just catch you using a "CALCULATE"?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can't we rely on anything any more?....&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 13:55:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220078#M52667</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2021-12-03T13:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220096#M52668</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81111" data-lia-user-login="HotChilli" class="lia-mention lia-mention-user"&gt;HotChilli&lt;/a&gt;&amp;nbsp;Ha! Good one. I was actually going to include a version using MINX but figured it was overkill. Was easier just to correct the version of the formula that used CALCULATE since it was already there.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 14:17:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220096#M52668</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-12-03T14:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220329#M52673</link>
      <description>&lt;P&gt;amazing&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, I've used the [EARLIER] option and it works so not going through the second :). Assuming not, but just to be sure, if there is any consideration in performance between these two options?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks again&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 16:58:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220329#M52673</guid>
      <dc:creator>derekmalag</dc:creator>
      <dc:date>2021-12-03T16:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220474#M52681</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="309136" data-lia-user-login="derekmalag" class="lia-mention lia-mention-user"&gt;derekmalag&lt;/a&gt;&amp;nbsp;In my testing, no I have not seen a performance difference between the two approaches. You might be interested in this:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/In-Defense-of-EARLIER/ba-p/2151415" target="_blank"&gt;In Defense of EARLIER - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 19:21:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220474#M52681</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-12-03T19:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220675#M52694</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="309136" data-lia-user-login="derekmalag" class="lia-mention lia-mention-user"&gt;derekmalag&lt;/a&gt;&amp;nbsp;If you're concerned about performance, then you should filter on columns rather than tables whenever possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd probably write it like this instead:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MIN_VALUE =
CALCULATE (
    MIN ( 'MyTable'[Total_Value] ),
    ALLEXCEPT ( 'MyTable', 'MyTable'[Model] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 Dec 2021 23:06:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220675#M52694</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-12-03T23:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Colum: Get MIN value from a filtered table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220848#M52710</link>
      <description>&lt;P&gt;Here is the simple one line solution:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Min_Value = &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'[Total Value]&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;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;EARLIER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table'[Model]&lt;/SPAN&gt;&lt;SPAN&gt;)=&lt;/SPAN&gt;&lt;SPAN&gt;'Table'[Model]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 04 Dec 2021 10:41:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Colum-Get-MIN-value-from-a-filtered-table/m-p/2220848#M52710</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-04T10:41:43Z</dc:date>
    </item>
  </channel>
</rss>

