<?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: Distributing 1 amount over different months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3557653#M136995</link>
    <description>&lt;P&gt;Using a constant as the second parameter of SUMX. How brilliant!!!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 01:38:01 GMT</pubDate>
    <dc:creator>FreemanZ</dc:creator>
    <dc:date>2023-11-29T01:38:01Z</dc:date>
    <item>
      <title>Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3556476#M136910</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;In my model I only have a 1 column table that lists several future periods (format YYYYMM).&lt;/P&gt;&lt;P&gt;I would like to distribute 1000 USD over these months. Each month should be allocated with 99 USD, until the whole amount has been fully allocated. I can't seem to find an elegant solution for this.&lt;/P&gt;&lt;P&gt;The desired output is pictured below.&lt;/P&gt;&lt;P&gt;Thanks in advance,&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;</description>
      <pubDate>Tue, 28 Nov 2023 13:00:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3556476#M136910</guid>
      <dc:creator>PDE</dc:creator>
      <dc:date>2023-11-28T13:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3556636#M136933</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="652961" data-lia-user-login="PDE" class="lia-mention lia-mention-user"&gt;PDE&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try to add two calculated columns like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Allocation = 
VAR _periodmin = MIN([Period])
VAR _period = [Period]
VAR _periodminSN = LEFT(_periodmin,4)*12+RIGHT(_periodmin, 2)
VAR _periodSN = LEFT(_period,4)*12+RIGHT(_period, 2)
VAR _gap = _periodSN -_periodminSN+1
VAR _quotient = QUOTIENT (1000, 99)
VAR _mod = MOD(1000, 99)
VAR _result = 
SWITCH( 
    TRUE(),
    _gap&amp;lt;=_quotient, 99,
    _gap= _quotient+1, _mod,
    0
)
RETURN _result &lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;RT = 
IF(
    [Allocation]&amp;lt;&amp;gt;0,
    SUMX(
        FILTER(
            data,
            data[Period]&amp;lt;=EARLIER(data[Period])
        ),
        [Allocation]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&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>Tue, 28 Nov 2023 14:19:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3556636#M136933</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-11-28T14:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3556820#M136953</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="652961" data-lia-user-login="PDE" class="lia-mention lia-mention-user"&gt;PDE&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have also tried a soluton, please check. Two calculated columns need to be added to your table:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Allocation = 
var __amount = 1000
var __monthly = 99
var __cumm = __monthly + __amount -  SUMX( FILTER( 'Table' , 'Table'[Month] &amp;lt;= EARLIER( 'Table'[Month] ) ),	__monthly)
var __val = MAX( min( __monthly , __cumm ) ,0)
    return
	__val&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Running Total = 
IF( 'Table'[Allocation] &amp;gt; 0 ,  SUMX( FILTER( 'Table' , 'Table'[Month] &amp;lt;= EARLIER( 'Table'[Month] ) ) , [Allocation] ))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 15:38:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3556820#M136953</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2023-11-28T15:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3557653#M136995</link>
      <description>&lt;P&gt;Using a constant as the second parameter of SUMX. How brilliant!!!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 01:38:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3557653#M136995</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-11-29T01:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3557795#M137007</link>
      <description>&lt;LI-CODE lang="markup"&gt;Allocation = 
MAX(
    MIN(
        99,
        1000 - COUNTROWS( WINDOW( 1, ABS, -1, REL, ALLSELECTED( data[Period] ) ) ) * 99
    ),
    0
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;RT = 
MIN(
    COUNTROWS( WINDOW( 1, ABS, 0, REL, ALLSELECTED( data[Period] ) ) ) * 99,
    1000
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 03:13:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3557795#M137007</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2023-11-29T03:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3558011#M137024</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;Use of&amp;nbsp;QUOTIENT and MOD in your solution is a cleaver work.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 06:33:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3558011#M137024</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2023-11-29T06:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3561059#M137257</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;Works perfect.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 13:01:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3561059#M137257</guid>
      <dc:creator>PDE</dc:creator>
      <dc:date>2023-11-30T13:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3561060#M137258</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 13:02:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3561060#M137258</guid>
      <dc:creator>PDE</dc:creator>
      <dc:date>2023-11-30T13:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3561064#M137259</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 13:03:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3561064#M137259</guid>
      <dc:creator>PDE</dc:creator>
      <dc:date>2023-11-30T13:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3562787#M137329</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474658" data-lia-user-login="ThxAlot" class="lia-mention lia-mention-user"&gt;ThxAlot&lt;/a&gt;&amp;nbsp;, I eventually implemented your solution because it's more versatile (as a measure). If you would be so kind, have you got an idea how to offset the 'Allocation' by x (e.g. 3) rows? So instead of starting the allocation in period 202312, it should start in 202403. TIA&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 09:47:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3562787#M137329</guid>
      <dc:creator>PDE</dc:creator>
      <dc:date>2023-12-01T09:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3563090#M137347</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 13:04:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3563090#M137347</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2023-12-01T13:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Distributing 1 amount over different months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3563263#M137354</link>
      <description>&lt;P&gt;Works like a charm, ThxAlot. Will take a while to fully understand but you helped me alot. Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 14:32:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distributing-1-amount-over-different-months/m-p/3563263#M137354</guid>
      <dc:creator>PDE</dc:creator>
      <dc:date>2023-12-01T14:32:53Z</dc:date>
    </item>
  </channel>
</rss>

