Forum Discussion

jac88's avatar
jac88
Helper II
4 years ago
Solved

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]), ...
  • jdbuchanan71's avatar
    4 years ago

    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:

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

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

     

     

  • Ashish_Mathur's avatar
    4 years ago

    Hi,

    You may download my PBI file from here.

    Hope this helps.