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

Cumulative Sum measure showing correct figures only when filtered in slicer

Dear all,

 

I am creating Cumulative sum for time spent  (WORKLOG_LOGGED_TIME) within table Worklogs. I have managed to create the measure that is showing the correct figures only when slicer is applied. When I clear the slicer, the figures are incorrect - I do believe that it is related to ALLSELECTED function however I tried to remove it or replace it with ALL but still without any success.

 

CUMULATIVE_LOGGED_TIME =

CALCULATE(SUM(Worklogs[WORKLOG_LOGGED_TIME]),
FILTER(
ALLSELECTED('Worklogs'),
'Worklogs'[WORKLOG_CREATION_DATE] <= MAX (Worklogs[WORKLOG_CREATION_DATE])
))

 

Slicer is applied:

IvanS_1-1639146140467.png

 

Slicer is NOT applied:

IvanS_3-1639146319921.png

 

I do also have date table as best practise, but if using data table, the measure is only summing the time spent on monthly basis - see below:

IvanS_4-1639146653799.png

 

Any help is much appreciated!

3 REPLIES 3
amitchandak
Super User
Super User

@IvanS , Will work best with date table

 

CUMULATIVE_LOGGED_TIME =
CALCULATE(SUM(Worklogs[WORKLOG_LOGGED_TIME]),
FILTER(
ALLSELECTED('Date'),
'Date'[Date] <= MAX (Date[Date])
))

 

or

 

CUMULATIVE_LOGGED_TIME =
CALCULATE(SUM(Worklogs[WORKLOG_LOGGED_TIME]),
FILTER(
ALLSELECTED('Worklogs'),
'Worklogs'[WORKLOG_CREATION_DATE] <= MAX (Worklogs[WORKLOG_CREATION_DATE])

&& 'Worklogs'[Issue_key] <= MAX (Worklogs[Issue_key])
))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

starting from the bottom with solution without date table - working when filterred, not working when filter is cleared (expecting value of 19 800)

IvanS_1-1639152219112.png

 

IvanS_0-1639151911399.png

 

Solution with date table - only summing the time spent per each month (not cumullating).

IvanS_2-1639152434534.png

 

Below is the 1-to-many relationship between the tables. The date table was configured as per this link: Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutio...

IvanS_3-1639152545102.png

 

Any ideas what might be wrong?

Hi, @IvanS 

The specific reason is difficult to determine.

Can you post some sample data in table form or pbix file(without sensitive data) and your expected result for further research?

 

Best Regards,
Community Support Team _ Eason

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.