Cheat Sheets/Power BI/FIRSTDATE / LASTDATE
DAX function

FIRSTDATE / LASTDATEDAX function reference

First/last date in context.

Syntax

dax
FIRSTDATE(<dates>)    LASTDATE(<dates>)

Examples

dax
LASTDATE('Date'[Date])
A date

Often used as the opening side of an opening/closing balance pair.

dax
CALCULATE(SUM(Sales[Amount]), FIRSTDATE('Date'[Date]))
Sales on the earliest date currently in context

The standard pattern for non-additive measures like inventory or headcount.

dax
CALCULATE([Total Inventory], LASTDATE('Date'[Date]))
Closing/point-in-time balance

Common mistakes & gotchas

Related DAX functions

From Time intelligence

← Back to the Power BI (DAX) cheat sheet