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
gbarr12345
Post Prodigy
Post Prodigy

Cumulative Total query

Hi,

 

I have data that I've been asked to include a cumulative total beside.

 

All the data is from the 1st day of various months:

 

gbarr12345_0-1722893908082.png

 

 

However when I add the cumulative total, it puts it inside dates for the middle of the month which leaves blanks in the volume section:

 

gbarr12345_1-1722893953072.png

 

 

How do I get the blanks to not appear?

 

My current measure code is below:

 

Depletion Cumulative Total =
CALCULATE(
    SUM(Depletion[9LE]),
    FILTER(
        ALL(Dim_Date[Date]),
        Dim_Date[Date] <= MAX(USA[Date])
    )
)
1 ACCEPTED SOLUTION

Try this, and let me know if there are any problems:

Depletion Cumulative Total =
IF ( NOT ISBLANK(SUM(Depletion[9LE])),
CALCULATE(
SUM(Depletion[9LE]),
FILTER(
ALLSELECTED(Dim_Date[Date]),
Dim_Date[Date] <= MAX(Dim_Date[Date])
)))

View solution in original post

5 REPLIES 5
ahadkarimi
Solution Specialist
Solution Specialist

Hi, you can try this to remove blanks:
Depletion Cumulative Total =
IF ( ISBLANK(SUM(Depletion[9LE])),
BLANK(),
CALCULATE( SUM(Depletion[9LE]),

FILTER( ALL(Dim_Date[Date]), Dim_Date[Date] <= MAX(USA[Date]))))

Hi,

 

Thank you for your response. 

 

I tried this but it doesn't seem to work:

 

gbarr12345_0-1722897641567.png

 

Try this, and let me know if there are any problems:

Depletion Cumulative Total =
IF ( NOT ISBLANK(SUM(Depletion[9LE])),
CALCULATE(
SUM(Depletion[9LE]),
FILTER(
ALLSELECTED(Dim_Date[Date]),
Dim_Date[Date] <= MAX(Dim_Date[Date])
)))

That worked, thank you so much!

My pleasure!

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.