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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Rafael_Batista_
Regular Visitor

Cumulative over the previous day in Power BI

Balanço =
VAR DataAtual = MAX('CR - Saldo'[Data])
VAR _PagoAcum =
         CALCULATE( [Diferença],
                 FILTER(
                      ALLSELECTED('CR - Saldo'),
                        'CR - Saldo'[Data] <= DataAtual))

RETURN [Saldo] + _PagoAcum

This formula calculates the accumulated balance each day, what formula should I use to bring the balance from the previous day to the informed?

1 ACCEPTED SOLUTION
gmsamborn
Super User
Super User

Hi @Rafael_Batista_ 

 

If I understand correctly, you are asking for the previous day's balance.  

 

If that's the case, I made a change to your measure:

 

Previous Day Balanço =
VAR _DataAtual = MAX( 'CR - Saldo'[Data] )
VAR _Yesterday = _DataAtual - 1
VAR _PagoAcum =
    CALCULATE(
        [Diferença],
        FILTER(
            ALLSELECTED( 'CR - Saldo' ),
            'CR - Saldo'[Data] <= _Yesterday
        )
    )
RETURN
    [Saldo] + _PagoAcum

 

 

 

Can you show the definitions for these measures?

[Diferença]

[Saldo]

 

I hope my initial assumption was correct.  Let me know.



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

5 REPLIES 5
Rafael_Batista_
Regular Visitor

Saldo anterior BI.png

 

Rafael_Batista_
Regular Visitor

Note that we have a data filter (highlighted in red) that requires the SALDO (Saldo = Balance) value to be one day earlier than that reported in the data filter Ex in the filter is from 01/23/2024 to 01/31/2024, that is, the value of the SALDO would have to be from 01/30/2024

gmsamborn
Super User
Super User

Hi @Rafael_Batista_ 

 

If I understand correctly, you are asking for the previous day's balance.  

 

If that's the case, I made a change to your measure:

 

Previous Day Balanço =
VAR _DataAtual = MAX( 'CR - Saldo'[Data] )
VAR _Yesterday = _DataAtual - 1
VAR _PagoAcum =
    CALCULATE(
        [Diferença],
        FILTER(
            ALLSELECTED( 'CR - Saldo' ),
            'CR - Saldo'[Data] <= _Yesterday
        )
    )
RETURN
    [Saldo] + _PagoAcum

 

 

 

Can you show the definitions for these measures?

[Diferença]

[Saldo]

 

I hope my initial assumption was correct.  Let me know.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Hi

Your assumption is right 
The objective of [Diferença] is my values of amount you moved in the cash, which will then be deducted from the balance

[Saldo] = Balance 

Fowmy
Super User
Super User

@Rafael_Batista_ 

Please provide more details and explain with some sample data and the expected results if possible.


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.