I am trying to select the record with the latest date, all of the records in the database have these basic columns AssetNumber, WorkOrderNumber, ScheduledEndDate, Department
I want to find all the latest work order "date" for each asset in a specific department. I have a basic measure and column to do this but it is not working.
How do I filter the records and then apply the max date function. I have tried using ALL, ALLEXCEPT, ALLSELECTED etc.
| ASSET | DEPARTMENT | WOSCHED_ENDDATE |
|-------|------------|-----------------|
| 2160 | 57257E | 11/29/2011 |
| 2160 | 57257E | 7/28/2014 |
| 6440 | 57257E | 3/5/2012 |
| 6440 | 57257E | 3/9/2015 |
At the basic level I need to remove the two records with the old dates from my visual. I can find the most recent (MAX) date of the entire column but I cannot get the MAX function to work in the context of the filtered values which by department like I have in the sample grid.
Thank you
MaxDate=MAX(WOSCHED_ENDATE)
and add it to the values table. See my answer update. – alejandro zuleta