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
jac88
Helper II
Helper II

Running Sum is not working

Hello, 

 

I am trying to calculate the running sum, but it doesn't sum and not working. Can anybody please tell me what's wrong?

RunningSum = CALCULATE(SUM('Transaction'[ARR_Amount__c_M]),
                FILTER('Transaction',  'Transaction'[Effective_Date__c] <= MAX('Transaction'[Effective_Date__c])))
RunningSum2 = CALCULATE(SUM('Transaction'[ARR_Amount__c_M]),
                FILTER(ALL('Transaction'[Effective_Date__c]),
                    'Transaction'[Effective_Date__c] > MAX('Transaction'[Effective_Date__c])-365 &&
                    'Transaction'[Effective_Date__c] <= MAX('Transaction'[Effective_Date__c])))

jac88_0-1650660505949.png

 

Sample File - 

https://drive.google.com/file/d/12t6zlshfjGaWuYxZ5NIEM4-yArGXs1Y3/view?usp=sharing

 

 

Thank you so much

 

 

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

@jac88 

In order to use time intelligence like running totals you really want a dedicated calendar table in your model.  Then you can disable auto date/time.

A calendar table can be make using DAX like this.  
New Table:

Dates = 
ADDCOLUMNS(
    CALENDARAUTO(),
    "Year",YEAR ( [Date] ),
    "Month Year", EOMONTH( [Date] , -1) +1
)

Disable auto date/time under File > Options > Current File:

jdbuchanan71_0-1650663153952.png

Then cahnge your running total measure like this.

RunningSum2 = 
CALCULATE (
    SUM ( 'Transaction'[ARR_Amount__c_M] ),
    DATESINPERIOD ( Dates[Date], MAX ( 'Transaction'[Effective_Date__c] ), -1, YEAR )
)

jdbuchanan71_1-1650663267842.png

I have attached my updated sample file for you to look at.

 

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
jac88
Helper II
Helper II

@Ashish_Mathur  & @jdbuchanan71  Thank you so much. I really appreciate your help. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  Hi, I was trying to get the rolling last 12 months running sum, and I found you have helped one of the people. I was using the same formula, but I don't think I am getting the same answer. Can you please take look if you have a free moment? I really appreciate your help. 

1 Cummulative Value = 
CALCULATE (
    SUM ( 'Transaction'[ARR_Amount__c_M]),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)
12 month running total = if(MAX('Calendar'[Date])<today(),BLANK(),AVERAGEX(CALCULATETABLE(SUMMARIZE('Calendar','Calendar'[Month],"ABCD",[1 Cummulative Value]),DATESBETWEEN('Calendar'[Date],EDATE(MIN('Calendar'[Date]),-11),MAX('Calendar'[Date]))),[ABCD]))

 

https://drive.google.com/file/d/1MRCx7tdZ97D9JVMOqPwRf06B4ar_p4XP/view?usp=sharing 

 

Again, thank you 

 

Hi,

I see the running total for April 2022 onwards.  What is the question?  Please show the expected result very clearly in a simple Table format.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jdbuchanan71
Super User
Super User

@jac88 

In order to use time intelligence like running totals you really want a dedicated calendar table in your model.  Then you can disable auto date/time.

A calendar table can be make using DAX like this.  
New Table:

Dates = 
ADDCOLUMNS(
    CALENDARAUTO(),
    "Year",YEAR ( [Date] ),
    "Month Year", EOMONTH( [Date] , -1) +1
)

Disable auto date/time under File > Options > Current File:

jdbuchanan71_0-1650663153952.png

Then cahnge your running total measure like this.

RunningSum2 = 
CALCULATE (
    SUM ( 'Transaction'[ARR_Amount__c_M] ),
    DATESINPERIOD ( Dates[Date], MAX ( 'Transaction'[Effective_Date__c] ), -1, YEAR )
)

jdbuchanan71_1-1650663267842.png

I have attached my updated sample file for you to look at.

 

 

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.