Forum Discussion
Last Date with Filter DAX
You should be able to create a measure like:
Measure = CALCULATE(MAX('Table'[Date]),FILTER('Table',[Status]="Success"))Put this in a table along with your columns you specified and you should be good to go.
- Eric_Zhang9 years agoMicrosoft Employee
@smoupre wrote:
You should be able to create a measure like:
Measure = CALCULATE(MAX('Table'[Date]),FILTER('Table',[Status]="Success"))Put this in a table along with your columns you specified and you should be good to go.
Just in case, you may use the process date('Table'[Date]) in a slicer,
Measure = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Batch Name], 'Table'[Process Name] ), FILTER ( 'Table', [Status] = "Success" ) ) - Anonymous9 years agoNot applicable
Thanks for the quick response Greg_Deckler & Eric_Zhang.
Yes, the DAX looks correct but when I use it in my report, it filters the entire table and shows only successful processes.
So Basically, it doesn't show failed process and last successful date against it.
So in the above test report, I need a last date against the first record, however, rest of the records should be visible too.
When I use above DAX, it filters all the record for status = "Completed".
- Anonymous9 years agoNot applicable
Just to give you an overall view,
It should look something like below:
Batch Name | Process Date| Process Name | status | last date
B1 | 12-05-2017|P1 | PN1| Completed | (NULL)
B2 | 13-05-2017|P2 | PN2| Completed | (NULL)
B1 | 14-05-2017|P1 | PN1| Failed| 12-05-2017
- Eric_Zhang9 years agoMicrosoft Employee
Anonymous
Try
Measure = VAR LastSuccessDate =CALCULATE ( MAX ( 'Table'[Process Date] ), ALLEXCEPT ( 'Table', 'Table'[Batch Name], 'Table'[Process Name] ), FILTER ( 'Table', [Status] = "Completed" ) ) RETURN IF(ISBLANK(LastSuccessDate),"",LastSuccessDate)