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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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 ?

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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