Forum Discussion
MAX FUNCTION FROM A DATE
- 1 year ago
I have found the solution:
Cost Recent Upd =
CALCULATE(
[Total IT Cost],
FILTER('IT Cost (KCar)','IT Cost (KCar)'[Wiser Date]=[Date Most Recent Upd]
))
Date Most Recent Upd =
CALCULATE(
MAX('IT Cost (KCar)'[Wiser Date]),
FILTER(
'IT Cost (KCar)',
CONTAINSSTRING('IT Cost (KCar)'[Budget Phase], "Upd")
)
)
Tks the others options did not retrive the results
fbittencourt ,Create a measure to get the latest Wiser Date based on the filter selection:
LastWiserDate =
VAR MaxDate = MAXX(ALLSELECTED('IT Cost (KCar)'), 'IT Cost (KCar)'[Wiser Date])
RETURN MaxDate
Create a measure to filter by budget phase and get the P&L Sub cost based on the latest Wiser Date:
DAX
P&LSubCost_LatestBudgetPhase =
VAR LatestDate = [LastWiserDate]
RETURN
CALCULATE(
SUM('IT Cost (KCar)'[P&L Sub cost]),
FILTER(
'IT Cost (KCar)',
'IT Cost (KCar)'[Wiser Date] = LatestDate &&
'IT Cost (KCar)'[Budget Phase] IN {"upd", "PMT"}
)
)
Unfortunately the mesures rejects the filter function.
Tks for your time!