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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
awff
Helper III
Helper III

Cumulative total that resets with slicer date

Hi there,

 

I have the following measure that calculates the cumulative total (running total) of opportunity values:

 

cumulativeOpportunitiesPipelineUSD = 
CALCULATE(
    [opportunitiesPipelineUSD], //This is just a simple calculate(sum()) measure
    FILTER(
        ALLSELECTED('0 dim_Dates'[Date]), 
        '0 dim_Dates'[Date] <= MAX('0 dim_Dates'[Date])
    )
)

 

 

I also have a date slicer that has three levels - year, quarter and month.

 

I essentially need the cumulative totals to reset for the period selected on the slicer. Currently, it continues off from the pervious periods as you can see below.

 

I really only need it to reset every period selected. So when I select 2023 Q3 then it will start from zero to the end of Q3, and if I select Q4 it will only show me the cumulative total starting from October to December. Same with if I select 2023 or 2024. I hope this makes sense...

 

awff_0-1691127379273.png

awff_1-1691127409651.png

 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @awff ,

 

In the sample formula below, the cumulative resets only if a period is selected and continues to accumulate from the earliest ALLSELECTED date if not period is selected.

Reset = 
VAR __MIN =
    CALCULATE ( MIN ( Dates[Date] ), ALLSELECTED ( Dates ) )
VAR __MAX =
    MAX ( Dates[Date] )
RETURN
    CALCULATE (
        [Sum of Values],
        FILTER ( ALLSELECTED ( Dates ), Dates[Date] >= __MIN && Dates[Date] <= __MAX )
    )

You can add a condition to it so it shows a different value if no period is selected

Reset =
VAR __MIN =
    CALCULATE ( MIN ( Dates[Date] ), ALLSELECTED ( Dates ) )
VAR __MAX =
    MAX ( Dates[Date] )
RETURN
    IF (
        NOT ( HASONEVALUE ( Dates[Period] ) ),
        [other value],
        CALCULATE (
            [Sum of Values],
            FILTER ( ALLSELECTED ( Dates ), Dates[Date] >= __MIN && Dates[Date] <= __MAX )
        )
    )

 

danextian_0-1691154151785.png

danextian_1-1691154170270.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @awff ,

 

In the sample formula below, the cumulative resets only if a period is selected and continues to accumulate from the earliest ALLSELECTED date if not period is selected.

Reset = 
VAR __MIN =
    CALCULATE ( MIN ( Dates[Date] ), ALLSELECTED ( Dates ) )
VAR __MAX =
    MAX ( Dates[Date] )
RETURN
    CALCULATE (
        [Sum of Values],
        FILTER ( ALLSELECTED ( Dates ), Dates[Date] >= __MIN && Dates[Date] <= __MAX )
    )

You can add a condition to it so it shows a different value if no period is selected

Reset =
VAR __MIN =
    CALCULATE ( MIN ( Dates[Date] ), ALLSELECTED ( Dates ) )
VAR __MAX =
    MAX ( Dates[Date] )
RETURN
    IF (
        NOT ( HASONEVALUE ( Dates[Period] ) ),
        [other value],
        CALCULATE (
            [Sum of Values],
            FILTER ( ALLSELECTED ( Dates ), Dates[Date] >= __MIN && Dates[Date] <= __MAX )
        )
    )

 

danextian_0-1691154151785.png

danextian_1-1691154170270.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hello, i have same problem with cumulative sum, I have slicers and i need show the cumulative sum consider two relationships (Plan and fact). Can you Expain me what mistake i do?

Works perfectly! Thank you so much!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors