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
Hi fbittencourt - can you check the below modified dax function?
P&L Sub Cost Latest =
VAR MaxYear = MAX('IT Cost (KCar)'[Wiser Year])
VAR MaxDate =
CALCULATE(
MAX('IT Cost (KCar)'[Wiser Date]),
'IT Cost (KCar)'[Wiser Year] = MaxYear
)
VAR LatestBudgetPhase =
CALCULATETABLE(
'IT Cost (KCar)',
'IT Cost (KCar)'[Wiser Date] = MaxDate,
'IT Cost (KCar)'[Wiser Year] = MaxYear,
'IT Cost (KCar)'[Budget Phase] IN {"upd", "PMT"} -- Adjust as needed
)
RETURN
CALCULATE(
SUM('IT Cost (KCar)'[P&L Sub Cost]),
LatestBudgetPhase
)
If you want to filter based on user selection, replace IN {"upd", "PMT"} with a slicer reference
'IT Cost (KCar)'[Budget Phase] IN VALUES('IT Cost (KCar)'[Budget Phase])
Hope this helps.
Hi rajendraongole1,
Based on the table I should have the result from P&L SUb Cost, filtering ascending on wiser date, we have the 5Upd, and filtering year 2023, your mesure has no errors but is showing blank values.
Tks again for your time