Forum Discussion
Rafael_Batista_
2 years agoRegular Visitor
Balance Calculation in Power BI
Good afternoon!
I need to do a balance calculation in Power BI, where I have the columns of Revenue, Expense and BalanceThe operation should work each day that there was movement, so it will take the balance of the previous day and add the revenue and subtract the expense of the day, thus generating a new balance for that date. As in the following example:
How could I perform this function in Power BI?
Thank you in advance 🙂
- Solucion:
Balanço =VAR DataAtual = MAX('CR - Saldo'[Data])var _PagoAcum =CALCULATE([Saldo Realizado],FILTER(ALLSELECTED('CR - Saldo'),'CR - Saldo'[Data] <= DataAtual))RETURN[Saldo] + _PagoAcum
4 Replies
- Ashish_MathurSuper User
Hi,
Similar problem solved in the attached files.
Hope this helps.
- Rafael_Batista_Regular Visitor
Hi
This is the format I am using, where the [Saldo] is the value of the balance and the [Saldo Realizado] is the result of Revenue - ExpenseCan you help me make the correction?
- Rafael_Batista_Regular VisitorBalaço =VAR valor1 = [Saldo]VAR pago=CALCULATE([Saldo Realizado],FILTER('Export','Export'[Data] <= MAX('Export'[Data])))RETURNpago + valor1
- Rafael_Batista_Regular VisitorSolucion:
Balanço =VAR DataAtual = MAX('CR - Saldo'[Data])var _PagoAcum =CALCULATE([Saldo Realizado],FILTER(ALLSELECTED('CR - Saldo'),'CR - Saldo'[Data] <= DataAtual))RETURN[Saldo] + _PagoAcum