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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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] ).










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


Proud to be a Super User!









"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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.