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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RamiSomar
Frequent Visitor

Filling Last NonBlank Available Balance for dates with no transactions

I've recently started to use DAX, I need your help for DAX function to get below disired table. 

Current table linked to calander table, Current table is simply presenting daily closing balance for 4 bank accounts with four differecne currenies. Missing dates are supposed to have last available balance. 

Thanks in Advance. 

 

Untitled.png

1 ACCEPTED SOLUTION

 

 

Bal = 
var d = SELECTEDVALUE(Calendar_Table[Date])
return 0+CALCULATE(
    LASTNONBLANKVALUE(
        Calendar_Table[Date],sum('Historical MT940'[Closing Balance])
    )
    ,Calendar_Table[Date]<=d
)

 

 

Also set your Calendar_Table[Date] field to "Show items with no data".

 

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

please provide the sample data in usable format (paste as table or attach).

 

 

Bal = 
var d = SELECTEDVALUE(Calendar_Table[Date])
return 0+CALCULATE(
    LASTNONBLANKVALUE(
        Calendar_Table[Date],sum('Historical MT940'[Closing Balance])
    )
    ,Calendar_Table[Date]<=d
)

 

 

Also set your Calendar_Table[Date] field to "Show items with no data".

 

Many thanks, it works perfectly. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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