cancel
Showing results for
Did you mean:
Highlighted
Member

Sum cumulative productions

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

 Year Prouction Cummulative 1 5 5 2 80 85 3 14 94 4 56 70 5 78 134

How can I make the cummulative column?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User I

Re: Sum cumulative productions

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:

Let me know if this works.

Thanks,

Tejaswi

2 REPLIES 2
Super User I

Re: Sum cumulative productions

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:

Let me know if this works.

Thanks,

Tejaswi

Community Support Team

Re: Sum cumulative productions

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:

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.

Announcements

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!