<?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 Filter expression in Calculate to only pull earliest date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-expression-in-Calculate-to-only-pull-earliest-date/m-p/1852120#M39575</link>
    <description>&lt;P&gt;This seems like it should be easy but I'm having trouble with syntax. I have a summary table and detail table that are joined together by an ID (1:*).&amp;nbsp; In my visual, I want to show items from the summary table, with the Earliest PromiseDate from the detail table. No problem - built-in PBI capability. Now, I also want to show the concatenated BuyerID for all the detail rows where the PromiseDate = Earliest PromiseDate. I'm not sure the right syntax to filter this appropriately. Ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the measure I tried on my summary table, but I get the error "A function MIN has been used in a True/False expression that is used as a table filter expression. This is not allowed."&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BuyerID Concat = CALCULATE(CONCATENATEX(DISTINCT('Detail'[BuyerID]),'Detail'[BuyerID],", "),MIN('Detail'[PromisedDate]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The concatenate part works perfectly, except it shows up in the total line.&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 17:19:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-19T17:19:10Z</dc:date>
    <item>
      <title>Filter expression in Calculate to only pull earliest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-expression-in-Calculate-to-only-pull-earliest-date/m-p/1852120#M39575</link>
      <description>&lt;P&gt;This seems like it should be easy but I'm having trouble with syntax. I have a summary table and detail table that are joined together by an ID (1:*).&amp;nbsp; In my visual, I want to show items from the summary table, with the Earliest PromiseDate from the detail table. No problem - built-in PBI capability. Now, I also want to show the concatenated BuyerID for all the detail rows where the PromiseDate = Earliest PromiseDate. I'm not sure the right syntax to filter this appropriately. Ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the measure I tried on my summary table, but I get the error "A function MIN has been used in a True/False expression that is used as a table filter expression. This is not allowed."&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BuyerID Concat = CALCULATE(CONCATENATEX(DISTINCT('Detail'[BuyerID]),'Detail'[BuyerID],", "),MIN('Detail'[PromisedDate]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The concatenate part works perfectly, except it shows up in the total line.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 17:19:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-expression-in-Calculate-to-only-pull-earliest-date/m-p/1852120#M39575</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-19T17:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter expression in Calculate to only pull earliest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-expression-in-Calculate-to-only-pull-earliest-date/m-p/1852146#M39578</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;BuyerID Concat =
CALCULATE(
    CONCATENATEX(
        DISTINCT( 'Detail'[BuyerID] ),
        'Detail'[BuyerID],
        ", "
    ),
    FIRSTDATE( 'Detail'[PromisedDate] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filters under CALCULATE must &lt;STRONG&gt;always&lt;/STRONG&gt; be tables (logical conditions of the form T[Col] = Value are converted into tables under the hood and are what's called syntactic sugar). MIN returns a scalar. FIRSTDATE returns a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on your requirements you might need to wrap FIRSTDATE(....) in KEEPFILTERS.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 17:30:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-expression-in-Calculate-to-only-pull-earliest-date/m-p/1852146#M39578</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-19T17:30:58Z</dc:date>
    </item>
  </channel>
</rss>

