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

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

Reply
minasaleh669
New Member

Cumulative Total excluding some data

Hello everyone,

in this table START_Date & END_DATE columns have 3 values or more (values and their sum), I want to get cumulative for sum values only.... thank u for ur helpScreenshot 2022-06-21 131403.png 

 
1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @minasaleh669,

 

You may try this Measure.

CumulativeTotalExcludingData =
VAR cumulativeTotal =
    CALCULATE (
        SUM ( 'Table'[ACT_COST] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[END_DATE] ),
            'Table'[Index] <= MAX ( 'Table'[Index] )  //sum by the order in the screeshot
            //'Table'[WBS_ID] <= MAX ( 'Table'[WBS_ID] ) //sum by WBS_ID ascending
        )
    )
RETURN
    IF (
        MAX ( 'Table'[START_DATE] ) >= DATE ( 2019, 5, 1 )
            && MAX ( 'Table'[START_DATE] ) <= DATE ( 2019, 7, 1 ),
        cumulativeTotal,
        BLANK ()
    )

 

As this Measure calculates cumulative total by the order in the screenshot, you need add an extra index column in Power Query Editor(Transform Date). If you just would like to get cumulative total by the order of WBS_ID ascending, then you can try the annotated code.

 

The result looks like this.

vcazhengmsft_0-1656035494232.png

 

Also, attached the pbix file.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

4 REPLIES 4
v-cazheng-msft
Community Support
Community Support

Hi @minasaleh669,

 

You may try this Measure.

CumulativeTotalExcludingData =
VAR cumulativeTotal =
    CALCULATE (
        SUM ( 'Table'[ACT_COST] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[END_DATE] ),
            'Table'[Index] <= MAX ( 'Table'[Index] )  //sum by the order in the screeshot
            //'Table'[WBS_ID] <= MAX ( 'Table'[WBS_ID] ) //sum by WBS_ID ascending
        )
    )
RETURN
    IF (
        MAX ( 'Table'[START_DATE] ) >= DATE ( 2019, 5, 1 )
            && MAX ( 'Table'[START_DATE] ) <= DATE ( 2019, 7, 1 ),
        cumulativeTotal,
        BLANK ()
    )

 

As this Measure calculates cumulative total by the order in the screenshot, you need add an extra index column in Power Query Editor(Transform Date). If you just would like to get cumulative total by the order of WBS_ID ascending, then you can try the annotated code.

 

The result looks like this.

vcazhengmsft_0-1656035494232.png

 

Also, attached the pbix file.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

tamerj1
Super User
Super User

minasaleh669
New Member

@tamerj1 

Could u help me?

minasaleh669
New Member

@amitchandak 

could u help me!!

Helpful resources

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