Forum Discussion
RoseyAlexa
6 years agoHelper I
Lookup value based on date between a range
I have two tables: Timesheets - has staff hours and the date they worked those hours Career History - has a Start Date and End Date that an employee worked at a particular Branch In the Timeshe...
RoseyAlexa
6 years agoHelper I
JarroVGITthanks for helping.
Here is what I translated your code into:
Timesheet Branch =
VAR staffID = 'Timesheets'[Staff_ID]
VAR timeSheetDate = 'Timesheets'[Timesheet Date]
RETURN
CALCULATE(SELECTEDVALUE('Career History'[Branch], "Multi"), FILTER('Career History', 'Career History'[Staff_ID] = staffID && 'Career History'[Career History Start Date] <= timeSheetDate && OR('Career History'[Career History End Date] = BLANK(), 'Career History'[Career History End Date]> timeSheetDate)))
JarroVGIT
6 years agoResident Rockstar
That seems to be correct. Is it possible to share your PBIX? You can PM me the link and I will have a look, I think the datamodel is different then that I currently think.