Forum Discussion
Return date with highest score
- 6 years ago
Hi Anonymous ,
You can create two calculated columns:
max_score = CALCULATE( MAX(Sheet7[score]), FILTER(ALLSELECTED(Sheet7),Sheet7[Name]=EARLIER(Sheet7[Name])))max_date = CALCULATE( MAX(Sheet7[date]), FILTER(ALLSELECTED(Sheet7),Sheet7[Name]=EARLIER(Sheet7[Name])))Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous am still working on this. here is the current status.
I got the score correctly. but there is an issue with Date. even though am filtering with score and Name still am not getting corrct result.
MaxScore = MAX(Employee[score])
MaxDate = CALCULATE(MAX(Employee[Date]),
FILTER(Employee,Employee[score]=[MaxScore]
&& Employee[Name] = SELECTEDVALUE(Employee[Name])))
Anonymous ,
I think you're on the right track. You can try adding an ALL remove filter context to return all the names, and then filter it down by date. Try this:
ScoreMaxDate =
var _Score = MAX(Employee[SCORE])
var _SelectedUser = SELECTEDVALUE(Employee[NAME], BLANK())
RETURN
IF(NOT ISBLANK(_SelectedUser), CALCULATE(MAX(Employee[DATE]), ALL(Employee[NAME]), FILTER(Employee, _Score = Employee[SCORE] && _SelectedUser = Employee[NAME])))