Forum Discussion
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 building up the day For example: If on 01/30/2024 I have 10 releases Instead of it calculating value by value in my balance It only shows the final value of the last release and I needed it to calculate value by value (I calculate what I say is Balance + Revenue or Balance - Expense)
Form Dax using:
Meanings
[Saldo] = Balance
Tanks for you help 🙂
- Anonymous2 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 ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- Rafael_Batista_Regular Visitor
This is the result of the formulaThis is the expected result of launches on the same date
- AnonymousNot applicable
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 ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- Rafael_Batista_Regular Visitor
Thaks for your answer, but for me isn't work because [ID]
I haven't this Data- AnonymousNot applicable
Hi Rafael_Batista_ ,
This ID column is not required, you can replace it with a date column.
Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.