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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Slicer not acting as expected with cumulative totals

Hi,
I have a dataset that looks like this:


Worklogs

SpentDateDataEntryDateSecondsSpent
26/07/202326/07/202327000
27/07/202330/07/202313500
27/07/202330/07/202313500

 

RequiredTime

RequiredDateRequiredSeconds
26/07/202327000
27/07/202327000

 

Calendar (created using DAX)

DateYearQtrQtrNumMonthMonthNumMonthYearNumMonthYearDayDayName
          

Here's the DAX I used:

 

Calendar = 
VAR _calendar = CALENDARAUTO()
RETURN
    ADDCOLUMNS(
        _calendar,
        "Year", YEAR([Date]),
        "Qtr", "Q"& FORMAT([Date],"Q"),
        "QtrYear", "Q"& FORMAT([Date],"Q yyyy"),
        "QtrNum", FORMAT([Date],"Q"),
        "Month", FORMAT([Date],"mmmm"),
        "MonthNum", MONTH([Date]),
        "MonthYearNumber",FORMAT([Date],"yymm"),
        "MonthYear",FORMAT([Date],"mmm yyyy"),
        "Day",Format([Date],"dd"),
        "DayName",Format([Date],"dddd"
    ))

 

I have created a date hierarchy from this table that is like this:

  • Dates
    • Year
    • QtrYear
    • MonthYear
    • Day

 

I have the following measures:

 

Spent (d) = 
DIVIDE(SUM('Worklogs'[SecondsSpent]),27000)

 

 

 

Cumulative Days Spent (SpentDate)  =
CALCULATE(
    [Spent (d)],
    USERELATIONSHIP(Worklogs[SpentDate],'Calendar'[Date]),
    FILTER(ALL('Calendar'[Date]),'Calendar'[Date] <= MAX('Calendar'[Date])))

 

 

 

Cumulative Days Spent (DataEntryDate) = 
CALCULATE(
    [Spent (d)],
    USERELATIONSHIP(Worklogs[DataEntryDate],'Calendar'[Date]),
    FILTER(ALL('Calendar'[Date]),'Calendar'[Date] <= MAX('Calendar'[Date])))

 

 

 

Expected (d) = 
DIVIDE(SUM(RequiredTime[RequiredSeconds]),27000)

 

 

 

Cumulative Expected (d) = 
CALCULATE(
    [Expected (d)],
    USERELATIONSHIP(RequiredTime[RequiredDate],'Calendar'[Date]),
    FILTER(ALL('Calendar'[Date]),'Calendar'[Date] <= MAX('Calendar'[Date])))

 

 

I want to create a line chart that plots the Date on the x-axis and all three cumulative values on the y-axis. I'd then like to use a slicer for the date so that I can see a single month in isolation.

 

The line chart seems to work OK when not using a slicer, but it shows far too much data to be valuable for my use case - the data goes back ~10 years in the Worklogs table, but only ~5 years in the RequiredTime table.

 

When I use the slicer (the date hierarchy from the calendar table), the Spent (d) and Expected (d) values are returned correctly, but the cumulative values seem to calculate by summing all values up to and including the date selected. I'd like the cumulative values to only sum values for the month selected in the slicer.

 

Thanks in advance.

Sean

0 REPLIES 0

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.