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

Calculate cumulative sum for a selected date

Hello,

I want to calculate cumulative sum for a specific date range. It should also have the total sum until the start date.

Example table:

Zahin_0-1678883579680.png

 

Now if I want to see the cumulative sum for May to September, it should be something like this:

Zahin_1-1678883628274.png

 

How can I achieve this? Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Zahin ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a meausre.

Measure =
VAR _max =
    MAXX ( ALLSELECTED ( 'Table 2' ), 'Table 2'[Date] )
VAR _min =
    MINX ( ALLSELECTED ( 'Table 2' ), 'Table 2'[Date] )
VAR _re =
    CALCULATE (
        SUM ( 'Table'[amount] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Month] <= MAX ( 'Table'[Month] ) )
    )
RETURN
    IF (
        MAX ( 'Table'[Month] ) >= _min
            && MAX ( 'Table'[Month] ) <= _max,
        _re,
        BLANK ()
    )

vpollymsft_1-1679378539084.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Zahin ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a meausre.

Measure =
VAR _max =
    MAXX ( ALLSELECTED ( 'Table 2' ), 'Table 2'[Date] )
VAR _min =
    MINX ( ALLSELECTED ( 'Table 2' ), 'Table 2'[Date] )
VAR _re =
    CALCULATE (
        SUM ( 'Table'[amount] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Month] <= MAX ( 'Table'[Month] ) )
    )
RETURN
    IF (
        MAX ( 'Table'[Month] ) >= _min
            && MAX ( 'Table'[Month] ) <= _max,
        _re,
        BLANK ()
    )

vpollymsft_1-1679378539084.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Zahin , you need measure like

 

values For beginning 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

Only for selected range

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))

 

Same you can do with window function

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

 

Running Total/ Cumulative: https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=41

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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