cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Sum cumulative productions

Hello I want to find the cumulative production of one column, like this:

 

YearProuctionCummulative
155
28085
31494
45670
578134

 

How can I make the cummulative column?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
tejaswidmello Established Member
Established Member

Re: Sum cumulative productions

Hi @OscarSuarez10 ,

 

Try this calculated Column:

 

Calculated Column = 
VAR PreviousRow =
    TOPN (
        1,
        FILTER (
            RUnn,
            RUnn[Year] < EARLIER ( RUnn[Year] )
               
        ),
        [Year], DESC
    )
VAR PreviousValue =
    MINX ( PreviousRow, [Production] )
RETURN
    RUnn[Production] + PreviousValue

 *RUnn is my table name

 

Here is what I get:

Capture2.PNG

 

Let me know if this works.

 

Thanks,

Tejaswi

2 REPLIES 2
Highlighted
tejaswidmello Established Member
Established Member

Re: Sum cumulative productions

Hi @OscarSuarez10 ,

 

Try this calculated Column:

 

Calculated Column = 
VAR PreviousRow =
    TOPN (
        1,
        FILTER (
            RUnn,
            RUnn[Year] < EARLIER ( RUnn[Year] )
               
        ),
        [Year], DESC
    )
VAR PreviousValue =
    MINX ( PreviousRow, [Production] )
RETURN
    RUnn[Production] + PreviousValue

 *RUnn is my table name

 

Here is what I get:

Capture2.PNG

 

Let me know if this works.

 

Thanks,

Tejaswi

Community Support Team
Community Support Team

Re: Sum cumulative productions

hi, @OscarSuarez10 

Try this formula to create a measure

Measure = var _prevalue=CALCULATE(SUM('Table'[Prouction]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])-1)) return
SUM('Table'[Prouction])+_prevalue

Result:

7.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 6 members 3,896 guests
Please welcome our newest community members: