<?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: Get first department join date for each client from a different table using DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754982#M2947</link>
    <description>&lt;P&gt;That will read only one start-date for all clients. I need this against every client as shown in the question. So it need to check with CleintID. I even tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(FIRSTDATE(ClientDepartments[StartDate]), ClientDepartments[ClientID] = Clients[ClientID] )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But got the error:&lt;/P&gt;&lt;P&gt;The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Aug 2019 09:22:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-01T09:22:01Z</dc:date>
    <item>
      <title>Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754926#M2943</link>
      <description>&lt;P&gt;In my scenario, many clients moving between departments and the system is tracking this using a table with columns like: ClientID/ DepartmentID/ Start date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I need to get a column with first department start-date for each client? I am trying to read this to a Client profile table from the above Department association table using DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FIRSTDATE('ClientDepartment'[StartDate]) will give only a single date for all clients.&amp;nbsp; I am looking to get something like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For Example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mathew - 12/03/ 2019&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;John - 09/ 07/ 2018&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Raju - 08/ 08/ 2019&amp;nbsp; etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(FIRSTDATE(ClientDepartments[StartDate]), ClientDepartments[ClientID] = Clients[ClientID])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but throwing an error&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 09:00:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754926#M2943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-01T09:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754970#M2944</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the below.&lt;/P&gt;&lt;PRE&gt;CALCULATE( FIRSTDATE( ClientDepartments[StartDate] ) )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 09:13:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754970#M2944</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2019-08-01T09:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754982#M2947</link>
      <description>&lt;P&gt;That will read only one start-date for all clients. I need this against every client as shown in the question. So it need to check with CleintID. I even tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(FIRSTDATE(ClientDepartments[StartDate]), ClientDepartments[ClientID] = Clients[ClientID] )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But got the error:&lt;/P&gt;&lt;P&gt;The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 09:22:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754982#M2947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-01T09:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754996#M2948</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From my understanding you have tried, as stated in you post.&lt;/P&gt;&lt;PRE&gt;FIRSTDATE( ClientDepartments[StartDate] ) &lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Using Calculate will introduce context transition and if you have relationship&amp;nbsp;on Client ID it would pick up first date for each client.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;CALCULATE(&amp;nbsp;FIRSTDATE( ClientDepartments[StartDate] )&amp;nbsp;)&lt;/PRE&gt;&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 09:31:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/754996#M2948</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2019-08-01T09:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/755099#M2953</link>
      <description>&lt;PRE&gt;[First Date by Department and Client] = -- calculated table
ADDCOLUMNS(
	SUMMARIZE(
		ClientDepartments[DepartmentID],
		ClientDepartments[ClientID]
	),
	"Department Very First Date",
		CALCULATE( MIN ( ClientDepartments[StartDate] ) )
)

[First Date by Client] = -- calculated table
ADDCOLUMNS(
	SUMMARIZE(
		ClientDepartments[ClientID]
	),
	"Very First Date",
		CALCULATE( MIN ( ClientDepartments[StartDate] ) )
)

-- But you should try this:

[First Date] = CALCULATE( MIN ( ClientDepartments[StartDate] ) )

-- and slice your data by Clients[ClientID]

-- Your measure throws an error because FIRSTDATE returns
-- a table, not a value, and you should have used
-- CALCULATETABLE instead of CALCULATE.&lt;/PRE&gt;&lt;P&gt;You should always check if a function returns a value or a table:&lt;/P&gt;&lt;P&gt;&lt;A href="https://dax.guide/firstdate/" target="_blank"&gt;https://dax.guide/firstdate/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 11:15:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/755099#M2953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-01T11:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/755879#M2990</link>
      <description>&lt;P&gt;Thanks guys but sorry, I neither looking to add another calculated table nor as as measure but just trying to implemet this as a new column into the existing dimension table "Clients".&lt;/P&gt;&lt;P&gt;It is tabular model and no relationships created between any tables at the warehouse&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 03:33:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/755879#M2990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-02T03:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get first department join date for each client from a different table using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/756615#M3037</link>
      <description>&lt;P&gt;Well, if you put this&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;SPAN&gt;[First Date]&lt;/SPAN&gt; = -- calculated column&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;(&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;MIN&lt;/SPAN&gt; ( &lt;SPAN&gt;ClientDepartments[StartDate]&lt;/SPAN&gt; ),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ClientDepartments,&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ClientDepartments[DepartmentId]&lt;/SPAN&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ClientDepartments[ClientID]&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/PRE&gt;&lt;P&gt;in your column, it'll calculate what you want. Depending on how big your table is, this might be very slow due to context transition. You could, however, re-write the above without using any context transition using FILTER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 17:29:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-first-department-join-date-for-each-client-from-a-different/m-p/756615#M3037</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-02T17:29:23Z</dc:date>
    </item>
  </channel>
</rss>

