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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.