Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |