<?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: Calculated column to apply values from a different column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4121664#M163656</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="795118" data-lia-user-login="ayana" class="lia-mention lia-mention-user"&gt;ayana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try creating “CreditedAmount” column with the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CreditAmount = 
VAR CurrentMissedPaymentID = 'DataTable'[MissedPaymentID]

VAR CumulativeCollectedAmount =
CALCULATE(
    SUM('DataTable'[CollectedAmount]),
    FILTER(
        ALL('DataTable'),
        'DataTable'[Month] &amp;lt;= EARLIER('DataTable'[Month])
    )
)

VAR PreviousCumulativeMissedPmts =
CALCULATE(
    MAX('DataTable'[CumulativeMissedPmts]),
    FILTER(
        'DataTable',
        'DataTable'[MissedPaymentID] = CurrentMissedPaymentID - 1
    )
)

RETURN
IF(
    CumulativeCollectedAmount - 'DataTable'[CumulativeMissedPmts] &amp;gt;= 0,
    'DataTable'[MsdPmtAmount],
    MAX(0, CumulativeCollectedAmount - PreviousCumulativeMissedPmts)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my test result, i hope this can meet your requirement.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Jarvis Tang&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 01:32:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-28T01:32:27Z</dc:date>
    <item>
      <title>Calculated column to apply values from a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4111563#M163170</link>
      <description>&lt;P&gt;I'm working with debt collection data and I have a problem I hope someone can help resolve. Scenario: When there are several missed payments and a collection is made, it is applied to the oldest missed payment(s). For instance, if there are missed payments in Jan, Feb, Mar and April, ($500 each month, cumulative $2000) and a payment is made in April (e.g.$1000), that payment is applied to Jan ($500) and Feb ($500). If the total missedpayment is made ($2000), it is applied to Jan, Feb, March and April and the account becomes current. The challenge is that the source data does not have this information and I would like to create a DAX command to that applies the collected amount to the oldest missedpayments. Does anyone know if this is possible and if so, how? A sample table showing the expected results is included. For this, I'm only working with a fact table and a date table.&lt;/P&gt;&lt;P&gt;Thanks in advance for your insights!&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;</description>
      <pubDate>Wed, 21 Aug 2024 15:10:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4111563#M163170</guid>
      <dc:creator>ayana</dc:creator>
      <dc:date>2024-08-21T15:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column to apply values from a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4112177#M163192</link>
      <description>&lt;P&gt;which business question are you trying to answer with this?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 00:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4112177#M163192</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-08-22T00:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column to apply values from a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4121664#M163656</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="795118" data-lia-user-login="ayana" class="lia-mention lia-mention-user"&gt;ayana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try creating “CreditedAmount” column with the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CreditAmount = 
VAR CurrentMissedPaymentID = 'DataTable'[MissedPaymentID]

VAR CumulativeCollectedAmount =
CALCULATE(
    SUM('DataTable'[CollectedAmount]),
    FILTER(
        ALL('DataTable'),
        'DataTable'[Month] &amp;lt;= EARLIER('DataTable'[Month])
    )
)

VAR PreviousCumulativeMissedPmts =
CALCULATE(
    MAX('DataTable'[CumulativeMissedPmts]),
    FILTER(
        'DataTable',
        'DataTable'[MissedPaymentID] = CurrentMissedPaymentID - 1
    )
)

RETURN
IF(
    CumulativeCollectedAmount - 'DataTable'[CumulativeMissedPmts] &amp;gt;= 0,
    'DataTable'[MsdPmtAmount],
    MAX(0, CumulativeCollectedAmount - PreviousCumulativeMissedPmts)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my test result, i hope this can meet your requirement.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Jarvis Tang&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 01:32:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-to-apply-values-from-a-different-column/m-p/4121664#M163656</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-28T01:32:27Z</dc:date>
    </item>
  </channel>
</rss>

