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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
mauko
Regular Visitor

Cumulative sum even accross filtered data

We would like to analyze employee overtime with cumulative sum which would take into account all data even if they are filtered out by a slicer.  What I mean is that if an employee registers worktime from January 1st onwards, and by the end of March the cumulative overtime is x hours, when looking at the data for April the x would be taken into account as the "seed" number for April.  Now when I filter the worktime to only show April, the cumulative number starts from zero.  I tried to do this with a measure, but not lucky yet.  Is this possible?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @mauko 

 

You need to use a measure and use CALCULATE and ALL to get the final result. something similar to:

Total Hours = CALCULATE (SUM(Table[Hours]), FILTER (ALL(Table[Date]),Table[Date] <= MAX (Table[Date]) )

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @mauko 

 

You need to use a measure and use CALCULATE and ALL to get the final result. something similar to:

Total Hours = CALCULATE (SUM(Table[Hours]), FILTER (ALL(Table[Date]),Table[Date] <= MAX (Table[Date]) )

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Obrigado Miguel,

That worked.  I don't know what I was doing wrong before as I do think I already tried something like that.  One thing I find very difficult with PowerBI is to debug the measures...

Hi @mauko ,

 

The debugging of measures can imply to have concatanex, checking the filtering of tables,ca n be done in several different ways but one approach that I always try to follow is to filter out the information using the external tools liem DAXSTUDIO and TABULAREDITOR.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.