<?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: Accumulate calculated value over time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759947#M85511</link>
    <description>&lt;P&gt;i finally found a solution for me and i will guide you through the steps :&lt;BR /&gt;&lt;BR /&gt;first i created a&amp;nbsp; net profit measure&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Net Profit = 
VAR Totalrevenue = Calculate(SUM(Revenue[Amount]))
VAR Payroll = CALCULATE(SUM(Expenses[Amount]),FILTER(Expenses,Expenses[Category] = "Payroll Expenses"))
VAR Business = CALCULATE(SUM(Expenses[Amount]),FILTER(Expenses,Expenses[Category] = "Business Expenses"))
VAR Financial = CALCULATE(SUM(Expenses[Amount]),FILTER(Expenses,Expenses[Category] = "Financial Fees"))
Var Totalexpense = Calculate(SUM(Expenses[Amount]))
Var Grossprofit = (Totalrevenue - Totalexpense)
VAR Taxes = (Totalrevenue * 0.15)
VAR Netprofit = Grossprofit - Taxes
Return
Netprofit&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;later i created a "before" measure that calculates all net profit from my inital date to selected date in the following measure :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;before = VAR seldate = MAX(DateTable[Date])
RETURN
CALCULATE([Net Profit],DATESBETWEEN(DateTable[Date],"8/1/2022",seldate))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then i made my current payout which is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Current Payout = 
[Net Profit] * MAX(Investors[Percentage])&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;and finally i have the total payout which is :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Payout = ([before] * MAX(Investors[Percentage])) + MAX(Investors[Initial Value])&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;here are some photos of my results :&lt;BR /&gt;for week 1 :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;for week 2:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;all is left is for me to create a previous payout measure which i already know how to solve half of it i just need a similar calcualtion to the "before" measure but he seldate is 1 week before can anyone help?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&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;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Sep 2022 23:27:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-10T23:27:58Z</dc:date>
    <item>
      <title>Accumulate calculated value over time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759018#M85445</link>
      <description>&lt;P&gt;hellopowerbi community,&lt;BR /&gt;i have a dashboard i'm trying to build which includes&amp;nbsp; p/L report and next to it some investors payout.&lt;BR /&gt;i was able to build the P/L report with their value and previous period value.&lt;/P&gt;&lt;P&gt;now i want to build an accumulated table of payouts over time, i will share pic of how i want it to be but i played with the calculations just for the sake of showing you my desired results.&lt;BR /&gt;&lt;BR /&gt;you can see first the inital week i want it like this: &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;then if i select the next week i want it to look like this:&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; &lt;BR /&gt;you can find my dashboard here in the pbix file&lt;BR /&gt;&lt;A href="https://1drv.ms/u/s!Ag9tIyk2ofNRjkNFD9Do7eDErauI?e=j6xXZ2" target="_blank"&gt;https://1drv.ms/u/s!Ag9tIyk2ofNRjkNFD9Do7eDErauI?e=j6xXZ2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 19:20:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759018#M85445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-09T19:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate calculated value over time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759824#M85503</link>
      <description>&lt;P&gt;please refresh the download link&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 20:52:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759824#M85503</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-09-10T20:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate calculated value over time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759875#M85506</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!Ag9tIyk2ofNRjkTpg8L4VKb3_Rzw" target="_blank" rel="noopener"&gt;https://1drv.ms/u/s!Ag9tIyk2ofNRjkTpg8L4VKb3_Rzw&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 21:28:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759875#M85506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-10T21:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate calculated value over time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759940#M85510</link>
      <description>&lt;P&gt;your "Previous Payout" measure looks like it could use some cleanup.&amp;nbsp; Since you are already connecting to the dates table you could write it like this&lt;/P&gt;
&lt;P&gt;VAR _max =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; MIN ( 'DateTable'[Date] )&lt;BR /&gt;VAR _min =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 2* _max -MAX ( 'DateTable'[Date] )&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;and then use that to project that filter onto the Dates table.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;VAR Totalrevenue =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM ( Revenue[Amount] ),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER ( ALL (DateTable[Date]), DateTable[Date]&amp;gt;=_min &amp;amp;&amp;amp; DateTable[Date]&amp;lt;=_max)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Here is the full measure.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous Payout = 
VAR _max =
    MIN ( 'DateTable'[Date] )
VAR _min =
    2* _max -MAX ( 'DateTable'[Date] )
VAR Totalrevenue =
    CALCULATE (
        SUM ( Revenue[Amount] ),
        FILTER ( ALL (DateTable[Date]), DateTable[Date]&amp;gt;=_min &amp;amp;&amp;amp; DateTable[Date]&amp;lt;=_max)
    )
VAR Totalexpense =
    CALCULATE (
        SUM ( Expenses[Amount] ),
        FILTER ( ALL (DateTable[Date]), DateTable[Date]&amp;gt;=_min &amp;amp;&amp;amp; DateTable[Date]&amp;lt;=_max)
    )
VAR Grossprofit = ( Totalrevenue - Totalexpense )
VAR Taxes = ( Totalrevenue * 0.15 )
VAR Netprofit = Grossprofit - Taxes
RETURN Netprofit&lt;/LI-CODE&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;
&lt;P&gt;Hope this gets you closer to what you need.&lt;/P&gt;
&lt;P&gt;Note that your Investors table is not connected to the data model.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 23:13:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759940#M85510</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-09-10T23:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate calculated value over time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759947#M85511</link>
      <description>&lt;P&gt;i finally found a solution for me and i will guide you through the steps :&lt;BR /&gt;&lt;BR /&gt;first i created a&amp;nbsp; net profit measure&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Net Profit = 
VAR Totalrevenue = Calculate(SUM(Revenue[Amount]))
VAR Payroll = CALCULATE(SUM(Expenses[Amount]),FILTER(Expenses,Expenses[Category] = "Payroll Expenses"))
VAR Business = CALCULATE(SUM(Expenses[Amount]),FILTER(Expenses,Expenses[Category] = "Business Expenses"))
VAR Financial = CALCULATE(SUM(Expenses[Amount]),FILTER(Expenses,Expenses[Category] = "Financial Fees"))
Var Totalexpense = Calculate(SUM(Expenses[Amount]))
Var Grossprofit = (Totalrevenue - Totalexpense)
VAR Taxes = (Totalrevenue * 0.15)
VAR Netprofit = Grossprofit - Taxes
Return
Netprofit&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;later i created a "before" measure that calculates all net profit from my inital date to selected date in the following measure :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;before = VAR seldate = MAX(DateTable[Date])
RETURN
CALCULATE([Net Profit],DATESBETWEEN(DateTable[Date],"8/1/2022",seldate))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then i made my current payout which is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Current Payout = 
[Net Profit] * MAX(Investors[Percentage])&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;and finally i have the total payout which is :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Payout = ([before] * MAX(Investors[Percentage])) + MAX(Investors[Initial Value])&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;here are some photos of my results :&lt;BR /&gt;for week 1 :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;for week 2:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;all is left is for me to create a previous payout measure which i already know how to solve half of it i just need a similar calcualtion to the "before" measure but he seldate is 1 week before can anyone help?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&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;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 23:27:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulate-calculated-value-over-time/m-p/2759947#M85511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-10T23:27:58Z</dc:date>
    </item>
  </channel>
</rss>

