<?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 Rownumber() to act like SQL Row_Number() with Dynamic Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3557746#M137004</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="652548" data-lia-user-login="tdewitt274" class="lia-mention lia-mention-user"&gt;tdewitt274&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Please provide some sample date and can you explain how these figures were calculated?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I need to know the formula to find the DAX for you.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dino Tao&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 02:24:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-11-29T02:24:48Z</dc:date>
    <item>
      <title>DAX Rownumber() to act like SQL Row_Number() with Dynamic Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3554879#M136807</link>
      <description>&lt;P&gt;Hello, everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First off, I'd like to admit that I'm not well versed in DAX.&amp;nbsp; So, there might be a simpler process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a request to simulate the below SQL Server query using a dynamic date in Power BI.&amp;nbsp; Essentially, the most recent time that a "UniqueID" is used on or before a specific date.&lt;/P&gt;&lt;PRE&gt;WITH cte_test AS (&lt;BR /&gt;SELECT *, ROW_NUMBER() OVER (PARTITION BY UniqueID ORDER BY workDate desc) AS ROWID&lt;BR /&gt;FROM table1&lt;BR /&gt;WHERE workDate &amp;lt;= '2023-11-01'&lt;BR /&gt;)&lt;BR /&gt;SELECT max(workDate) AS workDate, status, count(UniqueID) AS countUniqueID, sum(AMOUNT_DUE) AS AMOUNT_DUE, sum(PRINCIPAL_AMOUNT) AS SUM_PRINCIPAL_AMOUNT, sum(INTEREST_AMOUNT) AS sum_INTEREST_AMOUNT&lt;BR /&gt;FROM cte_test&lt;BR /&gt;WHERE ROWID = 1&lt;BR /&gt;GROUP BY status;&lt;/PRE&gt;&lt;P&gt;I was able to get the data to come in as expected using the following DAX and a multiple select box.&amp;nbsp; The user wants the ability to change the date with the select box and update the data to use the new date as the "origin".&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;rwDateRank =&lt;/SPAN&gt; &lt;SPAN&gt;ROWNUMBER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;impData&lt;/SPAN&gt;&lt;SPAN&gt;[DWORK_OF_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;impData&lt;/SPAN&gt;&lt;SPAN&gt;[LOAN_ID]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ORDERBY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'impData'&lt;/SPAN&gt;&lt;SPAN&gt;[DWORK_OF_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DESC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; , &lt;/SPAN&gt;&lt;SPAN&gt;DEFAULT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; , &lt;/SPAN&gt;&lt;SPAN&gt;PARTITIONBY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'impData'&lt;/SPAN&gt;&lt;SPAN&gt;[LOAN_ID]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The issue I am running into is that I cannot aggregate the values by Status.&amp;nbsp; If I remove the Unique ID or Work Date, the data disappears and only shows the headings.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need to aggregate the data to show something like the below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Nov 2023 18:57:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3554879#M136807</guid>
      <dc:creator>tdewitt274</dc:creator>
      <dc:date>2023-11-27T18:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Rownumber() to act like SQL Row_Number() with Dynamic Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3557746#M137004</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="652548" data-lia-user-login="tdewitt274" class="lia-mention lia-mention-user"&gt;tdewitt274&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Please provide some sample date and can you explain how these figures were calculated?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I need to know the formula to find the DAX for you.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dino Tao&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 02:24:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3557746#M137004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-29T02:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Rownumber() to act like SQL Row_Number() with Dynamic Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3561210#M137264</link>
      <description>&lt;P&gt;Hello, Dino&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are just COUNT and SUM the "columns" section of the "Build visual" section.&lt;/P&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;Thanks,&lt;/P&gt;&lt;P&gt;Todd&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 14:13:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/3561210#M137264</guid>
      <dc:creator>tdewitt274</dc:creator>
      <dc:date>2023-11-30T14:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Rownumber() to act like SQL Row_Number() with Dynamic Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/4629840#M177242</link>
      <description>&lt;P&gt;ROWNUMBER IN DAX IS GARBAGE.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 19:29:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Rownumber-to-act-like-SQL-Row-Number-with-Dynamic-Date/m-p/4629840#M177242</guid>
      <dc:creator>hstance</dc:creator>
      <dc:date>2025-03-28T19:29:57Z</dc:date>
    </item>
  </channel>
</rss>

