Forum Discussion
SDream7
Helper I
7 years agoSelect Most Recent Client Record Given Date Values Selected
Hello everyone, I've been having trouble finding a solution for this problem, having not been able to replicate solutions posted to similar problems featured on the forums. In the link below,...
v-juanli-msft
Community Support
7 years agoHi SDream7
To show the latest record for each Client ID based on both the Admission and Discharge Dates selected, you could create these measures.
(i can't find any rows with both lastest Admission and Discharge Dates as the slicer show.
based on the slicer, lastest Admission and Discharge Dates are 2017/6/14 and 2018/5/15, but there isn't any row with 2017/6/14 and 2018/5/15 for Admission and Discharge Dates meanwhile
So i assume show the lastest Admission date based on the lastest Discharge Dates, this is to mean for the lastest Discharge Dates 2018/5/15, show the lastest Admission date 2017/5/28)
max of Admission Date = CALCULATE(MAX([Admission Date / Project Start Date]),ALLSELECTED(Sheet1)) max of Discharge Date = CALCULATE(MAX([Discharge Date]),ALLSELECTED(Sheet1)) based on last discharge daate = CALCULATE(MAX([Admission Date / Project Start Date]),FILTER(ALLSELECTED(Sheet1),[Discharge Date]=[max of Discharge Date])) last record = IF(MAX([Admission Date / Project Start Date])=[based on last discharge daate]&&MAX([Discharge Date])=[max of Discharge Date],1,0)
Best Regards
Maggie