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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
pietra
New Member

Calculated Column - Cumulative sum

I've searched the forum, but the main advice is to create a measure.
I need to create a calculated column, which will sum the cumulative value during the year, for each service in each company.

 

DateValueCompanyServiceCumulative value
Jan-2112413ax12413
Feb-21235ax12648
Mar-21235235ax247883
Jan-2113536bx13536
Feb-214575bx18111
Mar-2134533bx52644

 


I tried to make it this way:
CALCULATE(SUMX(Sheet1,Sheet1[Value]),FILTER(Sheet1,Sheet1[Date]<=MAX(Sheet1[Date])

Unfortunately this is not the good direction. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pietra ,

 

Please try this code to create a calcualted column.

Cumulative value = 
CALCULATE (
    SUM ( 'Sheet1'[Value] ),
    FILTER (
        ALLEXCEPT ( 'Sheet1', 'Sheet1'[Company] ),
        'Sheet1'[Date] <= EARLIER ( 'Sheet1'[Date] )
    )
)

My Sample:

RicoZhou_0-1665654972613.png

Result is as below.

RicoZhou_1-1665654982156.png

 

Best Regards,
Rico Zhou

 

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @pietra ,

 

Please try this code to create a calcualted column.

Cumulative value = 
CALCULATE (
    SUM ( 'Sheet1'[Value] ),
    FILTER (
        ALLEXCEPT ( 'Sheet1', 'Sheet1'[Company] ),
        'Sheet1'[Date] <= EARLIER ( 'Sheet1'[Date] )
    )
)

My Sample:

RicoZhou_0-1665654972613.png

Result is as below.

RicoZhou_1-1665654982156.png

 

Best Regards,
Rico Zhou

 

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

I tried using your code in a similar problem I have.. However, it doesn't accept the last part:

EARLIER ( 'Sheet1'[Date] )

 it doesn't accept the column name it gives me an error and says "can't find name" even though I just refereenced the same column in the first part: 

'Sheet1'[Date] <= EARLIER ( 'Sheet1'[Date] )

 

any help on how to resolve it?

Thank you so much for the support, it worked. 

vanessafvg
Community Champion
Community Champion

why does it need to be a column and not a measure?  do you have a date table?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.