Forum Discussion

rohitchouhan's avatar
rohitchouhan
Frequent Visitor
6 years ago

Addition in powerBI

 

I Want to calculate the current day backlog ,so need to do addition in the below-mentioned way.
Since I am new in Power BI,i searched alot but not finding solution. can someone tell me how to do this in power BI through measure or DAX or any possible way.  

 

I want result like column 2 which adds previous value+ current value

Column 1Column 2      
1010       
2030(10+20)      
1545(30+15)      
2570(45+25)      
        
        

3 Replies

  • vivran22's avatar
    vivran22
    Icon for Community Champion rankCommunity Champion

    Hello rohitchouhan ,

     

    You may try this:

     

     

    Running Total = 
    VAR _Current = 'Table'[Index]
    
    VAR _Filter = 
        FILTER(
            'Table',
            'Table'[Index] <= _Current)
    VAR _Sum = 
        CALCULATE(
            SUM('Table'[Column 1]),
            _Filter)
    
    RETURN
    _Sum

     

     

    For this formula to work as calculated column, you need a column as index. Either you can use a already existing column in your table which has a serial order (it can be a date column also), or you can add Index column using Power Query:

     

    Cheers!
    Vivek

    If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
    If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

    Blog: vivran.in/my-blog
    Connect on LinkedIn
    Follow on Twitter

  • Anonymous's avatar
    Anonymous
    Not applicable

    if you already have a date column in your dataset, you can try this,

    cummulative sum = CALCULATE(SUM('Table'[amount]),FILTER('Table','Table'[date]<=EARLIER('Table'[date])))
     
  • vivran22's avatar
    vivran22
    Icon for Community Champion rankCommunity Champion

    rohitchouhan 

     

    I just noticed that you like my reply is there anything I am missing to mark that as a solution?

     

    Cheers!
    Vivek

    If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
    If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

    Blog: vivran.in/my-blog
    Connect on LinkedIn
    Follow on Twitter