DAX code
Last Non-Blank Balance =
CALCULATE(
SUM('Ledger'[Balance]),
LASTNONBLANK('Date'[Date], CALCULATE(SUM('Ledger'[Balance])))
)
Returns the most recent non-blank value in a date range, the standard pattern for semi-additive measures like account balances.
Type your table and column names once. Every measure below updates.
Last Non-Blank Balance =
CALCULATE(
SUM('Ledger'[Balance]),
LASTNONBLANK('Date'[Date], CALCULATE(SUM('Ledger'[Balance])))
)
This is the standard DAX pattern for values that shouldn't be summed across time, such as account balances or inventory snapshots.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Last Non-Blank Value (Semi-Additive).