Forum Discussion
cmilligan262
Helper II
6 years agoLatest Date in same Month
I currently use a calculated column to find the most recent date in a table for a specific person. Max Date = calculate(Max('2020 Combined Roster'[Date]),Filter('2020 Combined Roster','2020 Comb...
amitchandak
Super User
6 years agoTry like
Measure =
VAR __id = MAX ( '2020 Combined Roster'[Employee ID] )
VAR __date = CALCULATE ( MAX( '2020 Combined Roster'[Date] ), ALLSELECTED ( 'Table' ), '2020 Combined Roster'[Employee ID] = __id )
RETURN CALCULATE ( max ( '2020 Combined Roster'[Date] ), VALUES ( '2020 Combined Roster'[Employee ID] ), '2020 Combined Roster'[Employee ID] = __id, '2020 Combined Roster'[Date] = __date )
cmilligan262
Helper II
6 years agoamitchandak So that's not quite working how I need it to. For example since it is not currently march and I have no data for march I want to to show the latest data for that person when I select march
- amitchandak6 years ago
Super User
Can you share sample data and sample output. If possible please share a sample pbix file after removing sensitive information.Thanks.
Proud to be a Datanaut My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970 - v-lili6-msft6 years ago
Community Support
hi cmilligan262
You could try this formula
Max Date = var _value=CALCULATE(MAX('2020 Combined Roster'[Date]), FILTER('2020 Combined Roster', '2020 Combined Roster'[Employee ID]=EARLIER('2020 Combined Roster'[Employee ID]) && '2020 Combined Roster'[Month Number]=EARLIER('2020 Combined Roster'[Month Number]))) return IF(ISBLANK('2020 Combined Roster'[Value]), CALCULATE(MAX('2020 Combined Roster'[Date]), FILTER('2020 Combined Roster', '2020 Combined Roster'[Employee ID]=EARLIER('2020 Combined Roster'[Employee ID]) &&'2020 Combined Roster'[Date]<EARLIER('2020 Combined Roster'[Date]))), _value)Result:
If not your case, please share your sample pbix file and your expected output.
Regards,
Lin
- amitchandak6 years ago
Super User
In case it does not resolve with the last posted solution. Can you share sample data and sample output.