<?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: Pull from a table the first transaction based on a date column. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915243#M95438</link>
    <description>&lt;P&gt;This is part of the previous one. Actually Table A has data for past 3 years and I want to have data only after 1 Feb in the new table. -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2022 14:33:51 GMT</pubDate>
    <dc:creator>mak_tushar</dc:creator>
    <dc:date>2022-11-18T14:33:51Z</dc:date>
    <item>
      <title>Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915052#M95420</link>
      <description>&lt;P&gt;I have a transaction table(A) with 4 columns say X, Y, Value and Date. I want to create a new table(B) from Table A such that Table B have unique transactions(rows) based on the combination of X and Y columns, and should pick only first transaction based on the date column. For example -&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table A:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X1&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;11-11-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X1&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;14-11-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X2&lt;/TD&gt;&lt;TD&gt;Y2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;13-11-2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table B: It should only have one row for X1 and Y1 combination for date: 11-11-2022 as it is the first trasaction.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X1&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;11-11-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;X2&lt;/TD&gt;&lt;TD&gt;Y2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;13-11-2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 12:36:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915052#M95420</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-18T12:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915078#M95426</link>
      <description>&lt;P&gt;Try to create a new table with the code below:&lt;/P&gt;&lt;P&gt;B =&lt;/P&gt;&lt;P&gt;ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;SUMMARIZE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A[X],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A[Y],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A[Value]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;"Date",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;CALCULATE (MIN(A[Date]))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 12:48:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915078#M95426</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-18T12:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915112#M95429</link>
      <description>&lt;P&gt;Is there a way to apply filter on the date as well? I want to pull records from table A that have invoice date greater than 1 feb.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 13:09:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915112#M95429</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-18T13:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915116#M95431</link>
      <description>&lt;P&gt;is it a new requirement or in addition to the previous one?Or could you elaborate the expected table in Excel?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 13:14:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915116#M95431</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-18T13:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915241#M95437</link>
      <description>&lt;P&gt;This is part of the previous one. Actually Table A has data for past 3 years and I want to have data only after 1 Feb in the new table. -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 14:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915241#M95437</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-18T14:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915243#M95438</link>
      <description>&lt;P&gt;This is part of the previous one. Actually Table A has data for past 3 years and I want to have data only after 1 Feb in the new table. -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 14:33:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915243#M95438</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-18T14:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915424#M95459</link>
      <description>&lt;P&gt;Then try this:&lt;/P&gt;&lt;P&gt;B =&lt;/P&gt;&lt;P&gt;CALCULATETABLE(&lt;/P&gt;&lt;P&gt;ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;SUMMARIZE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A[X],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A[Y],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A[Value]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;"Date",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;CALCULATE (MIN(A[Date]))&lt;/P&gt;&lt;P&gt;),&lt;/P&gt;&lt;P&gt;A[Date]&amp;gt;DATE(2022,1,1)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 16:08:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915424#M95459</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-18T16:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915490#M95464</link>
      <description>&lt;P&gt;Getting duplicate rows (based on X and Y column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 16:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915490#M95464</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-18T16:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915507#M95466</link>
      <description>&lt;P&gt;Is it an issue, considering you have different data in column Value and Date?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 16:44:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915507#M95466</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-18T16:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915985#M95496</link>
      <description>&lt;P&gt;how does the issue look like?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 23:35:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2915985#M95496</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-18T23:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2916097#M95504</link>
      <description>&lt;P&gt;First two rows are duplicate as the first three coulmn values are same. Form these two(duplicate) rows, I want only the first row in my table as it has an older date.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 05:01:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2916097#M95504</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-19T05:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2917806#M95583</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474120" data-lia-user-login="mak_tushar" class="lia-mention lia-mention-user"&gt;mak_tushar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
CALENDAR(
    MIN('Table'[Invoice Date]),MAX('Table'[Invoice Date]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag =
var _select=SELECTEDVALUE('Table 2'[Date])
return
IF(
    MAX('Table'[Invoice Date])=
MINX(FILTER(ALL('Table'),'Table'[X]=MAX('Table'[X])&amp;amp;&amp;amp;'Table'[Y]=MAX('Table'[Y])&amp;amp;&amp;amp;'Table'[Location]=MAX('Table'[Location])&amp;amp;&amp;amp;'Table'[Invoice Date]&amp;gt;=_select),[Invoice Date]),1,0)&lt;/LI-CODE&gt;
&lt;P&gt;3. Place [Flag]in Filters, set is=1, apply filter.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;4. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 06:47:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2917806#M95583</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-21T06:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Pull from a table the first transaction based on a date column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2920875#M95782</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/a&gt;, worked perfectly.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 08:14:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pull-from-a-table-the-first-transaction-based-on-a-date-column/m-p/2920875#M95782</guid>
      <dc:creator>mak_tushar</dc:creator>
      <dc:date>2022-11-22T08:14:18Z</dc:date>
    </item>
  </channel>
</rss>

