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

Power BI is turning 10! Letโ€™s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
gmaasz
New Member

cumulative column not working correctly with values taking place on same date

Hi, I have a list of payments in a table that I would like to cumulatively add up in a column based on the payment date. I am using the following query:

Running Total COLUMN = 
CALCULATE (
    SUM ( 'Application Payments'[AmountPaid] ),
    ALL ( 'Application Payments' ),
    'Application Payments'[PaymentDate].[Date] <= EARLIER ( 'Application Payments'[PaymentDate].[Date] )
)

 

You can see in the image below that when there are 2 records of data on the same date, then it doesn't work properly and it causes the value in the graph to jump up, and then again back down.

gmaasz_0-1698831102309.png

gmaasz_1-1698831168649.png

Please help ๐Ÿ™‚

 

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

Hi, @gmaasz 

try below code

 

just adjust table and column name

 

 

Measure = CALCULATE(
            SUM('Table'[amount paid]),
            'Table'[Column1]<MAX('Table'[Column1]),
            REMOVEFILTERS('Table'[amount paid])
        )+SUM('Table'[amount paid])

 

 

Dangar332_0-1699342154024.png

Dangar332_0-1699344799543.png

 

 

View solution in original post

9 REPLIES 9
Dangar332
Super User
Super User

Hi, @gmaasz 

try below code

 

just adjust table and column name

 

 

Measure = CALCULATE(
            SUM('Table'[amount paid]),
            'Table'[Column1]<MAX('Table'[Column1]),
            REMOVEFILTERS('Table'[amount paid])
        )+SUM('Table'[amount paid])

 

 

Dangar332_0-1699342154024.png

Dangar332_0-1699344799543.png

 

 

Worked like a bomb thanks

some_bih
Super User
Super User

Hi @gmaasz put Date column from your Calendar / Date table (should be unique)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






I created a unique date column, and then updated my cumulative column formula as follows:

 

Running Total COLUMN = 
CALCULATE (
    SUM ( 'Application Payments'[AmountPaid] ),
    ALL ( 'Application Payments' ),
    'Date Table'[Date] <= EARLIER ('Application Payments'[PaymentDate] )
)

 

 

the table values still show the same issue.

gmaasz_0-1698930453377.png

 

or you plot a table visual with date[date] column and a measure like:

 

 

Running Total Measure=

SUMX(

     FILTER(

        'Application Payments',

 

        'Application Payments'[PaymentDate]<=MAX('Date Table'[Date])

),

 

   'Application Payments'[AmountPaid]  

 

)

hi @gmaasz ,

 

Add the column in your data table, like
 
Running Total COLUMN=
SUMX(
     FILTER(
        RELATEDTABLE('Application Payments'),
        'Application Payments'[PaymentDate]<='Date Table'[Date]
),
   'Application Payments'[AmountPaid]  
)

gmaasz_0-1698995990359.png

My date table is not being picked up.

 

I created my date table separately with a formula giving me the following style output

gmaasz_1-1698996042821.png

 

hi @gmaasz ,

 

there was a typo. the column is supposed to add in your date table. It that so? You may also try the measure mentioned in another reply. 

Thanks my result is still not correct when using the measure:

gmaasz_0-1699338489979.png

Not sure where the typo is you are referring to? 

 

Maybe the issue is with my relationships? I have a 1 to many relationship with the date table and my application payments table.

gmaasz_1-1699338551259.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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