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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
PYL019
New Member

Calculating a cumulative value after a blank

Hi everyone, I have a question around how can I reset the cumulative value to 0 after there's a blank value in a table.

 

What I got from the cumulative formula is (A), where it continues to count after 2 blank forecast days. 

 

I want to be able to reset the blank forecast days back to 0 and start the cumulative calculation again. Can anyone help here?

 

Thanks!

 

DateForecastCumulative Forecast (A)Cumulative Forecast (B)
4-mar565656
5-mar56112112
6-mar56168168
7-mar   
8-mar   
9-mar5622456
10-mar91315147
11-mar46361193
12-mar91452284

 

1 ACCEPTED SOLUTION

Hi @PYL019 ,

Please follow the steps to have a try.

  • Create a calculated column firstly.
Count Blank Value =
CALCULATE (
    COUNTBLANK ( 'Table'[Forecast] ),
    FILTER ( 'Table', 'Table'[Date] <= EARLIER ( 'Table'[Date] ) )
)

4.PNG

  • Create a measure
Measure =
CALCULATE (
    SUM ( 'Table'[Forecast] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table'[Date] )
            && 'Table'[Count Blank Value] = MAX ( 'Table'[Count Blank Value] )
    )
)

 3.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

3 REPLIES 3
amitchandak
Super User
Super User

Is these breaks like the weekend ?

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

Sometimes...

 

I gave a specific example for a specific product at a specific warehouse. I hope you're able to guide me on how I can build a good report.

Hi @PYL019 ,

Please follow the steps to have a try.

  • Create a calculated column firstly.
Count Blank Value =
CALCULATE (
    COUNTBLANK ( 'Table'[Forecast] ),
    FILTER ( 'Table', 'Table'[Date] <= EARLIER ( 'Table'[Date] ) )
)

4.PNG

  • Create a measure
Measure =
CALCULATE (
    SUM ( 'Table'[Forecast] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table'[Date] )
            && 'Table'[Count Blank Value] = MAX ( 'Table'[Count Blank Value] )
    )
)

 3.PNG

Best Regards,

Xue Ding

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

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.