Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Edgar_massa
Helper II
Helper II

balance calculation

Good night guys

Here's the thing, I have a bank balance table that brings me the balance on the 1st of each month, and I have a fact table containing my realized balance (income - expense).

I need the print table just below

 

Edgar_massa_0-1693001142495.png

 

to calculate the simple sum of the balance made with the bank balance (- 1,406,019.86) + 7,738,756.96 which gives 6,332,737.10 on day 1, and this result of 6,332,737.10 is calculated on day 2 and so on.

Thanks

1 ACCEPTED SOLUTION
Edgar_massa
Helper II
Helper II

Good afternoon

I managed to solve it as follows

 

    VAR Saldo1 = [Saldo Realizado] + [Saldo de Contas]

    VAR Calc =
    CALCULATE(
        [Saldo Realizado] + [Saldo de Contas],
        FILTER(
            ALLSELECTED(
                dim_Calendario),
                [Saldo Realizado] + Saldo1 ),
               
                dim_Calendario[Data] <= MAX(dim_Calendario[Data])
    )
 
Edgar_massa_0-1693236522216.png

 

 
Very similar to your solution @danextian 
 
Very Thanks
 

View solution in original post

3 REPLIES 3
Edgar_massa
Helper II
Helper II

Good afternoon

I managed to solve it as follows

 

    VAR Saldo1 = [Saldo Realizado] + [Saldo de Contas]

    VAR Calc =
    CALCULATE(
        [Saldo Realizado] + [Saldo de Contas],
        FILTER(
            ALLSELECTED(
                dim_Calendario),
                [Saldo Realizado] + Saldo1 ),
               
                dim_Calendario[Data] <= MAX(dim_Calendario[Data])
    )
 
Edgar_massa_0-1693236522216.png

 

 
Very similar to your solution @danextian 
 
Very Thanks
 
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file and show the expected result for a few line items.  Also, if possible, please translate the column names of the Tables in English.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @Edgar_massa ,

If i undestand your use case right, you're getting the running balance of Saldo Realizado and add it to  Saldo Bancario. Try these measures:

=
CALCULATE (
    [Saldo Realizado],
    FILTER ( ALL ( datestable ), datestable[date] <= MAX ( datestable[date] ) )
) + [Saldo Bancario]

=
CALCULATE (
    [Saldo Realizado],
    FILTER (
        ALLEXCEPT ( datestable, datestable[month] ),
        datestable[date] <= MAX ( datestable[date] )
    )
) + [Saldo Bancario]

=
CALCULATE ( [Saldo Realizado], DATESMTD ( datestable[month] ) ) + [Saldo Bancario]

 

If Saldo Realizado and Saldo Bancario are not measures, replace them with something like SUM( table[Saldo Realizado ] ) and SUM( table[Saldo Bancario] ).





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.