<?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: Way to create a measure using DAX that is capable of adding the value of itself in the past in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028785#M45450</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321167" data-lia-user-login="STEPH0018" class="lia-mention lia-mention-user"&gt;STEPH0018&lt;/a&gt;&amp;nbsp;There is a way but it is incredibly ugly.&amp;nbsp;&lt;A href="https://gregdeckler.com/2019/03/06/previous-value-recursion-in-dax/" target="_blank"&gt;Previous Value (“Recursion”) in DAX – Greg Deckler&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Aug 2021 19:24:39 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2021-08-20T19:24:39Z</dc:date>
    <item>
      <title>Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028757#M45444</link>
      <description>&lt;P&gt;Hey guys!&lt;BR /&gt;I was wondering if there was any way I could create a measure using DAX that is capable of adding the value of itself in the past.&lt;/P&gt;&lt;P&gt;The first instance of the variable “Measure”, represented by the letter “a” in the yellow column, would be equal to 0. In the following instances, the value of the variable “Measure” should be equal to the value of the “Contribution” variable plus the “Measure” variable in the previous instance multiplied by the “Divisaocota” variable of the instance divided by the “Divisaocota” variable of the previous instance.&lt;/P&gt;&lt;P&gt;Here is an example of what I mean:&lt;/P&gt;&lt;P&gt;Measure0 = 0&lt;/P&gt;&lt;P&gt;Measure1 = Contribution1 + Measure0 (Divisaocota1/Divisaocota0)&lt;/P&gt;&lt;P&gt;Measure2 = Contribution2 + Measure1 (Divisaocota2/Divisacao1)&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;How would I go about doing this?&lt;/P&gt;&lt;P&gt;Thanks so much guys!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 19:10:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028757#M45444</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-20T19:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028785#M45450</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321167" data-lia-user-login="STEPH0018" class="lia-mention lia-mention-user"&gt;STEPH0018&lt;/a&gt;&amp;nbsp;There is a way but it is incredibly ugly.&amp;nbsp;&lt;A href="https://gregdeckler.com/2019/03/06/previous-value-recursion-in-dax/" target="_blank"&gt;Previous Value (“Recursion”) in DAX – Greg Deckler&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 19:24:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028785#M45450</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-20T19:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028804#M45452</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Greg,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I had seen your publication before and tried to do something similar with my data, but when replacing the "Value" I ended up not succeeding&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 19:41:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028804#M45452</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-20T19:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028808#M45453</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321167" data-lia-user-login="STEPH0018" class="lia-mention lia-mention-user"&gt;STEPH0018&lt;/a&gt;&amp;nbsp;Paste me some data as text and I can give it a whirl.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 19:44:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2028808#M45453</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-20T19:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2029963#M45500</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Here are the data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/1FXwuGd_HA1sOJn5aiFX6iDoXHIYLX51S?usp=sharing" target="_blank"&gt;https://drive.google.com/drive/folders/1FXwuGd_HA1sOJn5aiFX6iDoXHIYLX51S?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2021 19:50:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2029963#M45500</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-21T19:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2030626#M45534</link>
      <description>&lt;P&gt;You might want to give an index a try in PowerQuery, sorting first as required (Name, Date). Then it's much simpler to add the current measure to CALCULATE([MyMeasure],&amp;nbsp; Table[Index]=PreviousIndexVariable) while checking that the Client IDs still match.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 19:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2030626#M45534</guid>
      <dc:creator>Alexrai</dc:creator>
      <dc:date>2021-08-22T19:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2032237#M45576</link>
      <description>&lt;P&gt;Hi, Alexrai,&amp;nbsp;I already tried to do this, but it didn't work.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 12:26:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2032237#M45576</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-23T12:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2032280#M45578</link>
      <description>&lt;P&gt;I think about making each "name" separate, because then I wouldn't have this problem, but even so when it comes to making the account for only one "name", I'm having the same problem&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 12:42:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2032280#M45578</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-23T12:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2033866#M45627</link>
      <description>&lt;P&gt;Greg may post a better solution, but I would try solve it like this after sorting by ClientID and then DATE in PowerQuery and adding an index column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Client = Client[ClientID] - Get ID of current client&lt;/P&gt;&lt;P&gt;VAR IndexStart= CALCULATE(MIN(FactTable[Index]), FactTable[ClientID]=Client))&lt;/P&gt;&lt;P&gt;-- Now we have the starting index and clientID&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR CurrentIndex = FactTable[Index] -- Index of the current row in the matrix to work backward from&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR PreviousClientDate = LOOKUPVALUE(FactTable[Date], FactTable[Index], CurrentIndex-1)) -- Get the value of the date of previous entry and use it to filter the fact table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR CurrentTotal = FactTable[Contribution] + CALCULATE(SUM(FactTable[Contribution]), FactTable[Date]=PreviousClientDate, FactTable[ClientID] = ClientID) -- Add current contribution to the contribution belonging to the prior index ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;IF(CurrentIndex = IndexStart, 0, CurrentTotal) - If we are at the first index number for the client then return a zero&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option without an index would be to try something along the line of:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Add Contributions = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR ClientName = MAX(Facts[Name])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentDate = MAX('Date'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorStart = CALCULATE(MIN(Facts[Date]), Facts[Name] = ClientName, Facts[Date]&amp;lt; CurrentDate, REMOVEFILTERS('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorEnd = CALCULATE(MAX(Facts[Date]), Facts[Name] = ClientName, Facts[Date]&amp;lt; CurrentDate, REMOVEFILTERS('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorValue = CALCULATE(SUM(Facts[Contribution]), Facts[Name]=ClientName, DATESBETWEEN(Facts[Date], PriorStart, PriorEnd), REMOVEFILTERS('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentValue = SUM(Facts[Contribution])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR NewValue = CurrentValue + PriorValue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF(ISBLANK(PriorStart), CurrentValue, NewValue)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;You can reach into the previous row by filtering for all dates less than the date in the current row context and then taking the maximum, then using that to filter the fact table for the value you need and adding it to the current value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if that helps&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 01:53:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2033866#M45627</guid>
      <dc:creator>Alexrai</dc:creator>
      <dc:date>2021-08-25T01:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2033893#M45630</link>
      <description>&lt;P&gt;I'm just looking at the data quickly - if you don't have your model setup properly it's hard to use DAX. You'll need at least a calander table with consecutive dates marked as a date table, and that should be linked with a one to many relationship to a fact table in tabular format with each record like: ClientName, Contribution Amount, Date, whatever other column.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 04:56:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2033893#M45630</guid>
      <dc:creator>Alexrai</dc:creator>
      <dc:date>2021-08-24T04:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2035278#M45654</link>
      <description>&lt;P&gt;Hi, Alexrai,&amp;nbsp;I will try to do this and return here if I can. Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 14:26:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2035278#M45654</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-24T14:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2035683#M45668</link>
      <description>&lt;P&gt;Hi, Alexrai,&amp;nbsp;unfortunately it didn't work. T&lt;SPAN&gt;he calculation did not accumulate.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 16:54:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2035683#M45668</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-24T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2036308#M45684</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sorry may have been a bit late to be winging it, I created a non-indexed measure to get a cummulative total of contributions. The idea is the same. If you need to add multiplication by those other fields then you only need to pull values for CurrentDate and PriorEnd which can be accomplished with calculate.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Add Contributions = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR ClientName = MAX(Facts[Name])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentDate = MAX('Date'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorStart = CALCULATE(MIN(Facts[Date]), Facts[Name] = ClientName, Facts[Date]&amp;lt; CurrentDate, REMOVEFILTERS('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorEnd = CALCULATE(MAX(Facts[Date]), Facts[Name] = ClientName, Facts[Date]&amp;lt; CurrentDate, REMOVEFILTERS('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorValue = CALCULATE(SUM(Facts[Contribution]), Facts[Name]=ClientName, DATESBETWEEN(Facts[Date], PriorStart, PriorEnd), REMOVEFILTERS('Date'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentValue = SUM(Facts[Contribution])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR NewValue = CurrentValue + PriorValue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF(ISBLANK(PriorStart), CurrentValue, NewValue)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Output and model:&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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, 25 Aug 2021 01:53:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2036308#M45684</guid>
      <dc:creator>Alexrai</dc:creator>
      <dc:date>2021-08-25T01:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2037615#M45701</link>
      <description>&lt;P&gt;Thaks, Alexrai, but see, the first value is not zero, for the first date chosen by the user. I separated the data by name, I think it's easier, but I still haven't found a solution. what do you think of this question?&amp;nbsp;&lt;A title="How to get data from previous day" href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-get-data-from-previous-row-with-complex-measure/m-p/2036213#M45681" target="_self"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-get-data-from-previous-row-with-complex-measure/m-p/2036213#M45681&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 12:06:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2037615#M45701</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-25T12:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2040441#M45798</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Someone would have another idea?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 12:47:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2040441#M45798</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-26T12:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2040816#M45818</link>
      <description>&lt;P&gt;I downloaded the pbix but have been busy, I think it might be easier to have the values you need to run a cummulative sum on stored in a table rather than calculated in PowerBI as a measure but I'll try find some time this evening if no-one responds before then.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:28:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2040816#M45818</guid>
      <dc:creator>Alexrai</dc:creator>
      <dc:date>2021-08-26T15:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2040843#M45819</link>
      <description>&lt;P&gt;&lt;SPAN&gt;it is not possible to make the accumulated before because it depends on the data that the user chooses. Thank you very much. I put the data in another way on this link:&amp;nbsp;&lt;A title="Data from previous row" href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-get-data-from-previous-row-with-complex-measure/m-p/2036213#M45681" target="_self"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-get-data-from-previous-row-with-complex-measure/m-p/2036213#M45681&lt;/A&gt;&amp;nbsp; &amp;nbsp;I think it might be easier to do, if possible.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:37:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2040843#M45819</guid>
      <dc:creator>STEPH0018</dc:creator>
      <dc:date>2021-08-26T15:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Way to create a measure using DAX that is capable of adding the value of itself in the past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2041784#M45855</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Give this a try: BUT, for the code to work you'll need to use R[Data], R[Attributo] in the table visual and remove dCalandario and Names, then sort by R[Attributo]. It takes the past value of W[Valor] adds it to the current R[Valor] and multiplies by (Divisaocota2 / Divisaocota1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't stress the importance of having a fact table and dimensions in a Star Schema form so that PowerBI filters work correctly. "Name" in your model has no filter connected to COTA so the measure is not going to evalulate correctly in the context of the Name Table.&amp;nbsp; The calander table needs to have consecutive dates or DATEADD is not going to work properly either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CSum = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentDate = MAX(R[Data])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentName = MAX(R[Atributo])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR StartDate = CALCULATE(MIN(R[Data]), R[Data] &amp;lt; CurrentDate, R[Atributo]=CurrentName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorDate = CALCULATE(MAX(R[Data]), R[Data] &amp;lt; CurrentDate, R[Atributo]=CurrentName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentValue = MAXX(CALCULATETABLE(ADDCOLUMNS(SUMMARIZE(R, R[Data], R[Atributo]), "Contribution1", SUM(R[Valor])), R[Atributo]=CurrentName, dCalendario[DATA]=CurrentDate), [Contribution1])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorValue = MAXX(CALCULATETABLE(ADDCOLUMNS(SUMMARIZE(W, W[Data], W[Atributo]), "Contribution2", SUM(W[Valor])), W[Atributo]=CurrentName, dCalendario[DATA]=PriorDate), [Contribution2])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentDiva = CALCULATE([divisaocota], dCalendario[DATA]=CurrentDate)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PriorDiva = CALCULATE([divisaocota], dCalendario[DATA]=PriorDate)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(NOT ISBLANK(PriorValue), (CurrentValue + PriorValue) * CurrentDiva / PriorDiva )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hopefully that gets you close to where you need to be ^^&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Aug 2021 02:55:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Way-to-create-a-measure-using-DAX-that-is-capable-of-adding-the/m-p/2041784#M45855</guid>
      <dc:creator>Alexrai</dc:creator>
      <dc:date>2021-08-27T02:55:55Z</dc:date>
    </item>
  </channel>
</rss>

