Forum Discussion
Kingnico63000
2 years agoRegular Visitor
Sum elements based on first date
Hello, I have value like this ID Date Statut Value 1 1/01 Submitted 1 1 1/01 Submitted -1 2 2/01 Accepted 1 2 2/01 Accepted -1 1 3/01 Submitted 1 3 4/01 Verified 1 3 6/01 Verified 1 ...
- 2 years ago
See if this DAX can be helpful:
Latest Date Total per Status = var _LatestDate =LASTDATE('Table'[Date]) var _LatestDateStatus = LOOKUPVALUE('Table'[Status], 'Table'[Date], _LatestDate) -- return _LatestDate -- if you want to quick check -- return _LatestDateStatus -- if you want to quick check RETURN CALCULATE( -- sum('Table'[Value]) DISTINCTCOUNT('Table'[ID]) , FILTER( ALLSELECTED('Table'), 'Table'[Status] = _LatestDateStatus))
sevenhills
2 years agoSuper User
See if this DAX can be helpful:
Latest Date Total per Status =
var _LatestDate =LASTDATE('Table'[Date])
var _LatestDateStatus = LOOKUPVALUE('Table'[Status], 'Table'[Date], _LatestDate)
-- return _LatestDate -- if you want to quick check
-- return _LatestDateStatus -- if you want to quick check
RETURN CALCULATE( -- sum('Table'[Value])
DISTINCTCOUNT('Table'[ID])
, FILTER( ALLSELECTED('Table'), 'Table'[Status] = _LatestDateStatus))