Forum Discussion

Rafael_Batista_'s avatar
Rafael_Batista_
Regular Visitor
2 years ago
Solved

Balance for Calculation for each entry in the Balance

Good Afternoon  I need help calculating the balance of each value in my table I created a formula that calculates the balance according to the financial movement of the day But he does it by build...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Rafael_Batista_ ,

     

    I made simple samples and you can check the results below:

    Balance = var _Expense = MAX('Table'[Expense])
    RETURN IF(_Expense=BLANK(),MAX('Table'[Revenue]),-MAX('Table'[Expense]))
    
    Total = var _t = ADDCOLUMNS('Table',"TOTAL",SUMX(FILTER(ALL('Table'),[ID]<=EARLIER([ID])),[Balance]))
    RETURN MAXX(_t,[TOTAL])

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.