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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
btalahmbong
Advocate II
Advocate II

Cumulative Total using waterfall chart

Hi,

 

I have measure which calculates the total cases created by date and it works pretty well. Here is the code;

Total Number Of Cases = CALCULATE(COUNTROWS('Case') + 0, FILTER(ALLSELECTED('Case'[created on local date]), 'Case'[created on local date] <= MAX ( 'Case'[created on local date])))

The visual I'm using to display this measure is a waterfall chart.

I want to be able to show the cumulative total of cases for the last 30 days. The problem is that instead of summing up the cases before 30 days ago, the chart starts counting the total cases from 30 days ago and cumulates.
So for example; Instead of starting on June 20th with 600 cases created, my chart starts on June 20th with 20 cases. 

Is there around that would suit my requirements for this visual? 

Thanks!

2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@btalahmbong,

 

Here is a similar case for your reference.

http://community.powerbi.com/t5/Desktop/How-to-create-measure-for-waterfall-chart-that-begins-with/m...

Community Support Team _ Sam Zha
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

@btalahmbong,

 

Drag 'Calendar'[Date] to Category and use measure below.

Measure =
VAR minDate =
    CALCULATE (
        MIN ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Is last 30 Days] = TRUE () )
    )
VAR maxDate =
    CALCULATE (
        MAX ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Is last 30 Days] = TRUE () )
    )
VAR d =
    MAX ( 'Calendar'[Date] )
RETURN
    SWITCH (
        TRUE (),
        d = minDate, COUNTROWS ( FILTER ( 'Case', 'Case'[created on local date] <= d ) ),
        d > minDate
            && d <= maxDate, COUNTROWS ( FILTER ( 'Case', 'Case'[created on local date] = d ) )
    )
Community Support Team _ Sam Zha
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

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@btalahmbong,

 

Here is a similar case for your reference.

http://community.powerbi.com/t5/Desktop/How-to-create-measure-for-waterfall-chart-that-begins-with/m...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft This will work with slicers.

I'm looking for a solution that wouldn't need a slicer preferably. I already have a 'Is last 30 Days' field in my calendar date table that will slice the day for the last 30 days.


 

Thanks

@btalahmbong,

 

Drag 'Calendar'[Date] to Category and use measure below.

Measure =
VAR minDate =
    CALCULATE (
        MIN ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Is last 30 Days] = TRUE () )
    )
VAR maxDate =
    CALCULATE (
        MAX ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Is last 30 Days] = TRUE () )
    )
VAR d =
    MAX ( 'Calendar'[Date] )
RETURN
    SWITCH (
        TRUE (),
        d = minDate, COUNTROWS ( FILTER ( 'Case', 'Case'[created on local date] <= d ) ),
        d > minDate
            && d <= maxDate, COUNTROWS ( FILTER ( 'Case', 'Case'[created on local date] = d ) )
    )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Have a look at the Ultimate Waterfall Chart in Office Store and here as well:

 

 

https://dataviz.boutique/

 

FeatureSheetWaterfall6.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.