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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
newgirl
Post Patron
Post Patron

Cumulative Total in Calculated Column

Hello! I have sample table below and I tried to make a calculated column to compute for the cumulative total per Count grouping per month.

Below is my screen shot of my PBIX where the results do not show correctly while second picture shows he expected results I need.

 

I already tried using ALLSELECTED instead of ALL and EARLIER instead of MAX, but it still doesn't work.

 

Cumul = 
CALCULATE( SUM('Table'[SubTotal_Vol]),
FILTER(ALL('Table'[Date]),'Table'[Date] <= MAX('Table'[Date])))

 

PBIXPBIX

 

Expected ResultsExpected Results

 

Not sure if this info helps, but my Date column is just a combination of Month and Year and then converted data type into Date.

 

Cumul3.JPG

1 ACCEPTED SOLUTION
newgirl
Post Patron
Post Patron

I was able to use this formula:

Cumul = 
CALCULATE(SUM('Table'[SubTotal_Vol]),
FILTER(ALLEXCEPT('Table','Table'[Merged]), 'Table'[Date]<= EARLIER('Table'[Date]) && 'Table'[Merged] <= MAX('Table'[Merged])))

View solution in original post

5 REPLIES 5
HavenerTed
Advocate I
Advocate I

Hello all,

 

I was wonderfing if there is a way to get the cumulative column by employee and/or project number? RIght now I have the cumulative column which generates a sum much greater than it should be but when it is in measure format it works correctly. Essentially, I am trying to cumulative hours per employee instead of the whole entire company.

 

Let me know what you may have to help.

 

Thank you.

newgirl
Post Patron
Post Patron

I was able to use this formula:

Cumul = 
CALCULATE(SUM('Table'[SubTotal_Vol]),
FILTER(ALLEXCEPT('Table','Table'[Merged]), 'Table'[Date]<= EARLIER('Table'[Date]) && 'Table'[Merged] <= MAX('Table'[Merged])))

Hi! I am wondering, what is the Merged variable that you are using in your solution?

Hello! The Merged column is the merging of 2 columns in which how I grouped them. For example, I consider INLAND100 as one group, RETAILER327 as another, which helped compute for the cumulative for that group.CapturePBI.JPG

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @newgirl - I think you need

VAR _Date = MAX([Date]) 
ALLSELECTED()

REMOVEFILTERS([Date])

FILTER (  [Date] <= _Date)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors