Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OscarSuarez10
Helper III
Helper III

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
Anonymous
Not applicable

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

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

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.
Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.