<?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 Row by Over Partion in Dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257412#M54517</link>
    <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;I hope you have a splendid week.&lt;BR /&gt;I encountered the following question, and I hope you might help me here.&lt;BR /&gt;I tried to "convert" a query in SQL into dax, and I didn't manage to do so.&lt;BR /&gt;Here is the SQL query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;select 
ROW_NUMBER() OVER (PARTITION BY employee_id, customer_id ORDER BY Increament_copy_datetime desc) as row_num,
employee_id,
customer_id,
call_status,
Increament_copy_datetime
from tess_reports.fact_calls&lt;/LI-CODE&gt;&lt;P&gt;The results I'm expecting to get are the one marked in yellow (The one with the highest rank, means the one with the rank of 1).&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;&lt;P&gt;The idea here is to create a new table with the "yellow-marked" results as a variable (I plan to use this table with other filters and manipulations like so).&lt;BR /&gt;I'll appreciate your kind help!&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Dec 2021 21:44:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-27T21:44:46Z</dc:date>
    <item>
      <title>Row by Over Partion in Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257412#M54517</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;I hope you have a splendid week.&lt;BR /&gt;I encountered the following question, and I hope you might help me here.&lt;BR /&gt;I tried to "convert" a query in SQL into dax, and I didn't manage to do so.&lt;BR /&gt;Here is the SQL query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;select 
ROW_NUMBER() OVER (PARTITION BY employee_id, customer_id ORDER BY Increament_copy_datetime desc) as row_num,
employee_id,
customer_id,
call_status,
Increament_copy_datetime
from tess_reports.fact_calls&lt;/LI-CODE&gt;&lt;P&gt;The results I'm expecting to get are the one marked in yellow (The one with the highest rank, means the one with the rank of 1).&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;&lt;P&gt;The idea here is to create a new table with the "yellow-marked" results as a variable (I plan to use this table with other filters and manipulations like so).&lt;BR /&gt;I'll appreciate your kind help!&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Dec 2021 21:44:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257412#M54517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-27T21:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Row by Over Partion in Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257479#M54519</link>
      <description>&lt;P&gt;NewTable=TOPN(1,SourceTable,RANKX(ALL(SourceTable[Increament_copy_datetime]),CALCULATE(MAX(SourceTable[Increament_copy_datetime]),ALLEXCEPT(SourceTable,SourceTable[employee_id],SourceTable[customer_id],SourceTable[Increament_copy_datetime])),,ASC))&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 00:57:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257479#M54519</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2021-12-28T00:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Row by Over Partion in Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257674#M54527</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; if you have a table like this&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The TSQL's ROW_NUMBER() equivalent would be following which you can achieve with a measure from the exisitng table wothout creating any more table&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Row_Number = 
RANKX (
    FILTER (
        ALLSELECTED ( fact_calls ),
        fact_calls[customer_id] = MAX ( fact_calls[customer_id] ) --equivalent of PARTITION BY employee_id
            &amp;amp;&amp;amp; fact_calls[employee_id] = MAX ( fact_calls[employee_id] )--, customer_id
    ),
    [_Increament_copy_datetime], -- equivalent of ORDER BY Increament_copy_datetime desc
    ,
    DESC
)&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>Tue, 28 Dec 2021 03:37:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257674#M54527</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-28T03:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Row by Over Partion in Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257686#M54528</link>
      <description>&lt;P&gt;Thank you!!&lt;BR /&gt;It worked I appreciate your help :)))&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 04:26:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257686#M54528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-28T04:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Row by Over Partion in Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257690#M54529</link>
      <description>&lt;P&gt;Thank you too!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your method works for me as well!!&lt;/P&gt;&lt;P&gt;I&amp;nbsp;&lt;SPAN&gt;appreciate&amp;nbsp;the help:))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 04:39:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-Over-Partion-in-Dax/m-p/2257690#M54529</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-28T04:39:06Z</dc:date>
    </item>
  </channel>
</rss>

