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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Antmkjr
Post Patron
Post Patron

Cumulatively subtract from the current day

 
 

https://drive.google.com/file/d/1wJNNBhW5QY-4RGLd21lcYl15ECW20fvV/view?usp=sharing

 

The intention is to reverse calculate the opening balance from current balance (For Type =FC) till 2018 

 

 

5.PNG

2021 Feb 5 , TB balance = 436, so opening balance = 436-(-50) = 486
For Feb 4 , Amount =0 , so opening balance is still 486
For Feb 3, Amount = 100, so opening balance =486-100= 386 and so on…

 

Also when drilled up to the monthly level, it should show the opening balance for Feb 1 as Feb Month opening balance, opening balance for Jan 1 as Jan Month Opening balance etc.

 

At yearly level(drill up), the balance for Jan 1 2021 as 2021 opening balance… the opening balance for 2020 Jan 1 as 2020 opening balance and so on…

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Replace TODAY() with DATE(YEAR(TODAY()),12,31).  But you will see results for all the remaining months for the current year.  You can adapt that logic further as needed (or remove it).

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

Replace TODAY() with DATE(YEAR(TODAY()),12,31).  But you will see results for all the remaining months for the current year.  You can adapt that logic further as needed (or remove it).

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mahoneypat
Microsoft Employee
Microsoft Employee

Please try this measure expression

 

Open Balance =
VAR vMinDate =
    MIN ( 'Date'[Date] )
VAR vMaxDate =
    MAX ( 'Date'[Date] )
VAR vTB =
    CALCULATE (
        LASTNONBLANKVALUE (
            TB[Date],
            CALCULATE (
                SUM ( TB[TB Balance] )
            )
        ),
        ALL ( TB )
    )
VAR vCashFlow =
    CALCULATE (
        SUM ( Cashflow[Amount] ),
        ALL ( 'Date' ),
        Cashflow[Date] >= vMinDate
            && Cashflow[Date]
                <= TODAY ()
    )
RETURN
    IF (
        vMaxDate
            <= TODAY (),
        vTB - vCashFlow
    )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


6.PNG

It is fine except that for the highlighted part values are not coming.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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