Forum Discussion

Rafael_Batista_'s avatar
Rafael_Batista_
Regular Visitor
2 years ago
Solved

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