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
Fernando_PBI
Regular Visitor

How to stop cumulative values in graph/table after no more data?

Hi,

 

I used the New quick measure assitant to get a cumulative view of data, I was able to achieve somehwhat the result I was looking for, however, the line chart/table shows the total in the following months where there is no data.

 

For example, 1246 in Nov 2019 should be 0 by Dec 2019 given that there's no more information for the latter.

How can I stop this from happening?

 

Fernando_PBI_0-1691600427280.png

 

The generated DAX code from the New Quick Measure assitant is the following:

 

Qty running total in Month =
CALCULATE(
    SUM('Table'[Qty]),
    FILTER(
        CALCULATETABLE(
            SUMMARIZE(
                'Sort Order Table',
                'Sort Order Table'[Month Number],
                'Sort Order Table'[Month]
            ),
            ALLSELECTED('Sort Order Table')
        ),
        ISONORAFTER(
            'Sort Order Table'[Month Number], MAX('Sort Order Table'[Month Number]), DESC,
            'Sort Order Table'[Month], MAX('Sort Order Table'[Month]), DESC
        )
    )
)
 

Thank you in advance!

1 REPLY 1
amitchandak
Super User
Super User

@Fernando_PBI ,

With help from date table

 

If(not(isblank(SUM('Table'[Qty]))) , CALCULATE(SUM('Table'[Qty]),filter(allselected(date),date[date] <=max(date[Date]))) , blank())

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