<?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: Help with New Window function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035761#M103952</link>
    <description>&lt;P&gt;Superb! It worked. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the window function work with text or we should still keep an index column?&lt;/P&gt;</description>
    <pubDate>Sat, 21 Jan 2023 20:13:55 GMT</pubDate>
    <dc:creator>Ackbar-Learner</dc:creator>
    <dc:date>2023-01-21T20:13:55Z</dc:date>
    <item>
      <title>Help with New Window function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035439#M103930</link>
      <description>&lt;P&gt;Hi before i used below DAX to calculate running totals and it works fine.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Board02P&amp;amp;LRunningTotal = if(
     HASONEFILTER(TabPLGLItem[GLItem])
     ,
     CALCULATE(
             [Board01P&amp;amp;LAllTransactionAmountwithSign]
             ,
             ALL(TabPLGLItem[GLItem])
             ,
             TabPLGLItem[Index] &amp;lt;= VALUES(TabPLGLItem[Index])
             )
     ,
     blank()
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I am trying my hand at the new Window function and wrote following DAX:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Board02aP&amp;amp;LRunningTotal = 
CALCULATE(
    [Board01P&amp;amp;LAllTransactionAmountwithSign],
    WINDOW(
        0,ABS,
        0,REL,
        SUMMARIZE(ALLSELECTED(TabPLGLItem),TabPLGLItem[GLItem]),
        ORDERBY(TabPLGLItem[GLItem])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately, it is not giving me the same result. See below screenshot:&lt;/P&gt;&lt;P&gt;It is returning the same previous measure, which was calculating amount per row item:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what might went wrong with the window function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 14:48:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035439#M103930</guid>
      <dc:creator>Ackbar-Learner</dc:creator>
      <dc:date>2023-01-21T14:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with New Window function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035758#M103951</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435924" data-lia-user-login="Ackbar-Learner" class="lia-mention lia-mention-user"&gt;Ackbar-Learner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To replicate the behaviour of your original measure using the WINDOW function, a measure like this should work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Board02aP&amp;amp;LRunningTotal =
CALCULATE (
    [Board01P&amp;amp;LAllTransactionAmountwithSign],
    WINDOW (
        0, ABS,
        0, REL,
        ALL ( TabPLGLItem[GLItem], TabPLGLItem[Index] ),
        ORDERBY ( TabPLGLItem[Index] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Does this work as intended?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Explanation:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In order to order by &lt;STRONG&gt;TabPLGLItem[Index]&lt;/STRONG&gt; for the running total, you must include &lt;STRONG&gt;TabPLGLItem[Index]&lt;/STRONG&gt; in the Relation argument of WINDOW, and provide&amp;nbsp;T&lt;STRONG&gt;abPLGLItem[Index]&lt;/STRONG&gt; as the argument of ORDERBY.&lt;/LI&gt;
&lt;LI&gt;Your original measure used ALL to ignore existing filters (explicitly for &lt;STRONG&gt;TabPLGLItem[GLItem]&lt;/STRONG&gt; and implicitly for &lt;STRONG&gt;TabPLGLItem[&lt;/STRONG&gt;&lt;STRONG&gt;Index]&lt;/STRONG&gt;), so ALL should be used when specifying the Relation argument as well.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 20:07:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035758#M103951</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-01-21T20:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with New Window function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035761#M103952</link>
      <description>&lt;P&gt;Superb! It worked. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the window function work with text or we should still keep an index column?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 20:13:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035761#M103952</guid>
      <dc:creator>Ackbar-Learner</dc:creator>
      <dc:date>2023-01-21T20:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with New Window function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035771#M103955</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435924" data-lia-user-login="Ackbar-Learner" class="lia-mention lia-mention-user"&gt;Ackbar-Learner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You nned to have an item index column. please try&lt;/P&gt;
&lt;P&gt;Board02aP&amp;amp;LRunningTotal =&lt;BR /&gt;SUMX (&lt;BR /&gt;WINDOW (&lt;BR /&gt;0,&lt;BR /&gt;ABS,&lt;BR /&gt;0,&lt;BR /&gt;REL,&lt;BR /&gt;SUMMARIZE (&lt;BR /&gt;ALLSELECTED ( TabPLGLItem ),&lt;BR /&gt;TabPLGLItem[GLItem],&lt;BR /&gt;TabPLGLItem[ItemIndex]&lt;BR /&gt;),&lt;BR /&gt;ORDERBY ( TabPLGLItem[ItemIndex] )&lt;BR /&gt;),&lt;BR /&gt;[Board01P&amp;amp;LAllTransactionAmountwithSign]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 20:25:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035771#M103955</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-21T20:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with New Window function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035779#M103956</link>
      <description>&lt;P&gt;Great! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In order to specify the sort order of a text column (by anything other than its natural sort order), yes, you would need to keep the index column, and specify it as the argument of ORDERBY.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 20:38:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035779#M103956</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-01-21T20:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with New Window function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035990#M103966</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6799" data-lia-user-login="OwenAuger" class="lia-mention lia-mention-user"&gt;OwenAuger&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both your solutions worked except that there is one limitation with the window function. Doing a running total with data from Direct Query using a window function is limited to 1million rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I did the same running total using the previous way and it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This seems weird though&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt; as I kept everything the same and only changed the running total dax code. I guess the workings of the window function is pretty different at the back. Let me know if you have any workaround for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jan 2023 08:15:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Window-function/m-p/3035990#M103966</guid>
      <dc:creator>Ackbar-Learner</dc:creator>
      <dc:date>2023-01-22T08:15:52Z</dc:date>
    </item>
  </channel>
</rss>

