Forum Discussion

sohailstsindia's avatar
8 years ago
Solved

Runing Balance

how we can calulate runing balence amount.

 

VOUCHERINVOICEDebitCreditAmountRunning Balance
OPB-001336234780600-600 
OPB-0013632369203390-3390 
OPB-00135628092635006350 
OPB-0013552810104240-4240 
OPB-0013572837101800-1800 
OPB-00136130271390003900 
OPB-00133766305002500-2500 
OPB-00134066945501850-1850 
OPB-00134166945603750-3750 
OPB-00133966946001699-1699 

 

After calulation

 

VOUCHERINVOICEDebitCreditAmountRunning Balance
OPB-001336234780600-600-600
OPB-0013632369203390-3390-3990
OPB-001356280926350063502360
OPB-0013552810104240-4240-1880
OPB-0013572837101800-1800-3680
OPB-00136130271390003900220
OPB-00133766305002500-2500-2280
OPB-00134066945501850-1850-4130
OPB-00134166945603750-3750-7880
OPB-00133966946001699-1699-9579
  • v-ljerr-msft's avatar
    v-ljerr-msft
    8 years ago

    Hi sohailstsindia,

     

    Based on my test, you should be able to just use the formula below to create a new calculated column in your table to get Running Balance. :smileyhappy:

    Running Balance = 
    CALCULATE (
        SUM ( Table1[Amount] ),
        FILTER (
            ALL ( Table1 ),
            Table1[SUPLIER] = EARLIER ( Table1[SUPLIER] )
                && Table1[INVOICE] <= EARLIER ( Table1[INVOICE] )
        )
    )
    

     

    Regards

6 Replies

    • Zubair_Muhammad's avatar
      Zubair_Muhammad
      Community Champion

      sohailstsindia

       

      Step#2 Add this Calculated Column

       

      Runnning Balance =
      CALCULATE (
          SUM ( TableName[Amount] ),
          FILTER ( ALL ( TableName ), [Index] <= EARLIER ( TableName[Index] ) )
      )
    • sohailstsindia's avatar
      sohailstsindia
      Helper I
      SUPLIERVOUCHERINVOICEDebitCreditAmountRunning Balance
      Sup-001OPB-001336234780600-600 
      Sup-002OPB-0013632369203390-3390 
      Sup-002OPB-00135628092635006350 
      Sup-001OPB-0013552810104240-4240 
      Sup-002OPB-0013572837101800-1800 
      Sup-001OPB-00136130271390003900 
      Sup-002OPB-00133766305002500-2500 
      Sup-001OPB-00134066945501850-1850 
      Sup-002OPB-00134166945603750-3750 
      Sup-004OPB-00133966946001699-1699 

       

      I need Suplier wise, I added index its take lot of time to refresh and get meesage no enough memory, can any other way without index.

       

      SUPLIERVOUCHERINVOICEDebitCreditAmountRunning Balance
      Sup-001OPB-001336234780600-600-600
      Sup-001OPB-0013552810104240-4240-4840
      Sup-001OPB-00136130271390003900-940
      Sup-001OPB-00134066945501850-1850-2790
      Sup-001OPB-00133966946001699-1699-4489
      • v-ljerr-msft's avatar
        v-ljerr-msft
        Microsoft Employee

        Hi sohailstsindia,

         

        Based on my test, you should be able to just use the formula below to create a new calculated column in your table to get Running Balance. :smileyhappy:

        Running Balance = 
        CALCULATE (
            SUM ( Table1[Amount] ),
            FILTER (
                ALL ( Table1 ),
                Table1[SUPLIER] = EARLIER ( Table1[SUPLIER] )
                    && Table1[INVOICE] <= EARLIER ( Table1[INVOICE] )
            )
        )
        

         

        Regards