Forum Discussion
Ashik008
2 years agoFrequent Visitor
latest date column needed
Hi all, I need help with data . I have table with id and date data. I need a column with latest date if the id service id completed date 101 6/20/2024 101 5/10/2023 102 10/10/2023 ...
- 2 years ago
Latest Completed Date = CALCULATE ( MAX ( 'Table'[completed date] ), ALLEXCEPT ( 'Table', 'Table'[service id] ) )
ajohnso2
2 years agoSolution Supplier
Something like this should work:
Latest Completion Date =
VAR _ServiceID = SELECTEDVALUE('YourTable'[Service ID])
VAR _DateCompleted =
FILTER(
ADDCOLUMNS(
CALCULATETABLE(
ALL('YourTable'[Service ID], 'YourTable'[Date Completed])
),
"@MaxCompletedDate", 'YourTable'[Date Completed]
),
'YourTable'[Service ID] = _ServiceID
)
RETURN
MAXX(_DateCompleted, [@MaxCompletedDate])