Get the earliest/latest Date from column with possible repeated row value
Hi, I have a measure as below. How to get the earliest date for "Order Status-Closed" to calculate the hours difference?
For example, I want to take the date 31-Dec-20 7:12:00 PM as highlighted in yellow as Closed Date. Here is the pbix file.
Accepted to Closed = VAR a = data[ID] VAR b = MAXX ( FILTER(data, [ID] = a && [History New Value] = "Field Status - Accepted" ), data[History CreatedDate] ) VAR c = MAXX ( FILTER ( data, [ID] = a && [History New Value] = "Order Status - Closed" ), [History CreatedDate] ) RETURN IF(b<>BLANK()&&c<>BLANK(), DIVIDE ( DATEDIFF ( b, c, SECOND ), 3600 ))