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
newgirl
Helper V
Helper V

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
Helper V
Helper V

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
Frequent Visitor

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
Helper V
Helper V

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
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.