<?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: DAX expression for finding the new row for a given customer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3075012#M106889</link>
    <description>&lt;P&gt;It doesn't account for customers with more then two meetings.&lt;/P&gt;&lt;P&gt;In that case it will simply take the type of the latest meeting and apply to all previous meetings&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2023 16:08:58 GMT</pubDate>
    <dc:creator>sumsar10171</dc:creator>
    <dc:date>2023-02-10T16:08:58Z</dc:date>
    <item>
      <title>DAX expression for finding the new row for a given customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074586#M106854</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write a dax expression which will give me a new column for my table "meetings".&lt;/P&gt;&lt;P&gt;It's suppose to fetch the meeting type for the next meeting for the client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current table:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;CustomerID&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2023-02-01&lt;/TD&gt;&lt;TD&gt;Startup&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2023-02-01&lt;/TD&gt;&lt;TD&gt;Retention&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2023-02-01&lt;/TD&gt;&lt;TD&gt;Startup&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2023-02-05&lt;/TD&gt;&lt;TD&gt;Support&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2023-02-05&lt;/TD&gt;&lt;TD&gt;Adjustment&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm looking for:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;CustomerID&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Next meeting type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2023-02-01&lt;/TD&gt;&lt;TD&gt;Startup&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#008000"&gt;Adjustment&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2023-02-01&lt;/TD&gt;&lt;TD&gt;Retention&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;Support&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2023-02-01&lt;/TD&gt;&lt;TD&gt;Startup&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2023-02-05&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;Support&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2023-02-05&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#008000"&gt;Adjustment&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 12:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074586#M106854</guid>
      <dc:creator>sumsar10171</dc:creator>
      <dc:date>2023-02-10T12:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression for finding the new row for a given customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074708#M106867</link>
      <description>&lt;P&gt;You can create a column like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Next meeting type = 
VAR NextMeeting = OFFSET(
	1,
	'Table',
	ORDERBY( 'Table'[Date], ASC),
	PARTITIONBY( 'Table'[CustomerID])
)
VAR MeetingType = SELECTCOLUMNS( NextMeeting, "Type", 'Table'[Type])
RETURN MeetingType &lt;/LI-CODE&gt;
&lt;P&gt;If it complains that there may be duplicate rows you'll need to go into the modelling view, select the table and choose ID as the key column.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 13:59:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074708#M106867</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-02-10T13:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression for finding the new row for a given customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074735#M106872</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="444432" data-lia-user-login="sumsar10171" class="lia-mention lia-mention-user"&gt;sumsar10171&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column = 
MINX(
    TOPN(
        1,
        FILTER(
            TableName,
            TableName[CustomerID] = EARLIER(TableName[CustomerID])            
                &amp;amp;&amp;amp;TableName[Date] &amp;gt; EARLIER(TableName[Date])      
        ),
        TableName[Date],
        DESC
    ),
    TableName[Type]
)&lt;/LI-CODE&gt;&lt;P&gt;it worked like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 14:14:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074735#M106872</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-10T14:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression for finding the new row for a given customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074886#M106882</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="444432" data-lia-user-login="sumsar10171" class="lia-mention lia-mention-user"&gt;sumsar10171&lt;/a&gt;&amp;nbsp; with new DAX OFFSET; PFA&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
CALCULATE (
    [__type],
    OFFSET (
        1,
        DISTINCT ( ALL ( tbl ) ),
        ORDERBY ( tbl[Date], ASC ),
        KEEP,
        PARTITIONBY ( tbl[CustomerID] )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 15:19:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3074886#M106882</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2023-02-10T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression for finding the new row for a given customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3075012#M106889</link>
      <description>&lt;P&gt;It doesn't account for customers with more then two meetings.&lt;/P&gt;&lt;P&gt;In that case it will simply take the type of the latest meeting and apply to all previous meetings&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:08:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3075012#M106889</guid>
      <dc:creator>sumsar10171</dc:creator>
      <dc:date>2023-02-10T16:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression for finding the new row for a given customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3075030#M106892</link>
      <description>&lt;P&gt;Is it possible to write this as a column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:16:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-for-finding-the-new-row-for-a-given-customer/m-p/3075030#M106892</guid>
      <dc:creator>sumsar10171</dc:creator>
      <dc:date>2023-02-10T16:16:18Z</dc:date>
    </item>
  </channel>
</rss>

