Forum Discussion
Calculate running total based on Sort Column
- Anonymous6 years ago
Hi Anonymous
Use and modify the below Formula as per your need.
Running Total COLUMN = CALCULATE ( SUM ( 'table'[col1] ), ALL( 'table'), //ALLEXCEPT ( 'table', 'table'[] ) //If you want to group by any column 'table'[col2] <= EARLIER ( 'table'[col2] ) )https://www.wallstreetmojo.com/power-bi-running-total/
Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!
Regards,
Pranit
Thank you so much. This worked exactly as stated and I used the ALLEXCEPT filter to apply the running total to the applicable name.
Can you post the formula you used? I'm not getting the running total, just the total on each row when using the ALLEXCEPT filter. Table looks like below now -
| User | Amt | Running Total |
| 1 | 100 | 250 |
| 1 | 100 | 250 |
| 1 | 50 | 250 |
- Ashish_Mathur5 years agoSuper User
Hi,
Do you have a Date column? If yes, then share that dataset.
- Anonymous5 years agoNot applicable
Here's the table I'm using 'User_Payments' -
User_ID Tran_Date Tran_Amt Running_Deposits 100 7/1/2021 100 300 100 7/15/2021 125 300 100 7/18/2021 75 300 105 6/1/2021 120 220 105 6/30/2021 100 220 110 7/15/2021 50 50 115 6/15/2021 115 200 115 7/1/2021 85 299 Running_Deposits is a calculated column using this DAX code :
Running_Deposits =CALCULATE (SUM ( 'User_Payments'[Tran_Amt] ),ALLEXCEPT ('User_Payments','User_Payments'[User_ID]),'User_Payments'[User_ID]= EARLIER ( 'User_Payments'[User_ID] ))I'm getting the total for each User_ID, but not the running total. I'd like results like this:User_ID Tran_Date Tran_Amt Running_Deposits 100 7/1/2021 100 100 100 7/15/2021 125 225 100 7/18/2021 75 300 105 6/1/2021 120 120 105 6/30/2021 100 220 110 7/15/2021 50 50 115 6/15/2021 115 115 115 7/1/2021 85 200 I've tried <= and >= operators in the filters, but that does not yeild better results.
Thanks!
- Ashish_Mathur5 years agoSuper User