Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All
I would like to know if it possible to create a measure that get the earliest last date from table with a date and work it base and work with the filter context?
Have the following table:
Log Table
| Customer Id | Machine Id | Log Date | Value |
| 1 | a | 2021-01-22 | 250 |
| 1 | a | 2021-01-23 | 265 |
| 2 | b | 2021-01-22 | 500 |
| 2 | b | 2021-01-24 | 356 |
| 3 | c | 2021-01-25 | 265 |
| 3 | c | 2021-01-26 | 541 |
| 4 | d | 2021-01-23 | 524 |
| 4 | d | 2021-01-24 | 365 |
Customer
| Customer Region | Customer Area | Customer Id |
| z | v | 1 |
| z | v | 2 |
| z | w | 3 |
| x | y | 4 |
I would like the measure create the following results
| Customer Region | Earlist Last Date |
| z | 2021-01-23 |
| x | 2021-01-24 |
Then next level
| Customer Region | Customer Area | Earlist Last Log Date |
| z | v | 2021-01-23 |
| z | w | 2021-01-26 |
| x | y | 2021-01-24 |
I try create the measure like
'Log Table'[Last Script Log Date] =
VAR CurrentLastDate = MINX(
CALCULATETABLE('Log Table',
'Log Table'[MachineId] = 'Log Table'[MachineId]
, LASTDATE('Log Table'[Log Date])
)
,'Log Table'[Log Date])
RETURN IF(ISBLANK( CurrentLastDate ),DATE(1,1,1),CurrentLastDate )
Solved! Go to Solution.
Please try this measure expression, replacing T1 for your actual table name.
Min Max =
VAR vMaxDates =
SUMMARIZE (
T1,
T1[Customer Id],
"cMaxDate", MAX ( T1[Log Date] )
)
RETURN
MINX (
vMaxDates,
[cMaxDate]
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this measure expression, replacing T1 for your actual table name.
Min Max =
VAR vMaxDates =
SUMMARIZE (
T1,
T1[Customer Id],
"cMaxDate", MAX ( T1[Log Date] )
)
RETURN
MINX (
vMaxDates,
[cMaxDate]
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
had trouble interpreting your question.
best guess.
mFirstLogDate:=MIN(tblLog[Date])mLastLogDate:=MAX(tblLog[Date])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |