Forum Discussion
Anonymous
7 years agoNot applicable
Look up using date range
I know this has been covered a bunch of times. But I can't seem to understand exactly how to set it up. Essentially I have an expense report, and I want to do a look up by employee number to see what...
- 7 years ago
Hi Anonymous ,
My error forget to change all the names that I used in my example this should do the trick:
Job title = CALCULATE ( FIRSTNONBLANK ( 'Employee Dynamic'[Job Title]; 1 ); FILTER ( ALL ( 'Employee Dynamic' ); 'Employee Dynamic'[EmployeNumber] = 'Travel 2019'[Employee] && 'Employee Dynamic'[Date Start] <= 'Travel 2019'[Date] && 'Employee Dynamic'[Date End] >= 'Travel 2019'[Date] ) ) Budget Group = CALCULATE ( FIRSTNONBLANK ( 'Employee Dynamic'[Budget Group]; 1 ); FILTER ( ALL ( 'Employee Dynamic' ); 'Employee Dynamic'[EmployeNumber] = 'Travel 2019'[Employee] && 'Employee Dynamic'[Date Start] <= 'Travel 2019'[Date] && 'Employee Dynamic'[Date End] >= 'Travel 2019'[Date] ) )Regards,
MFelix
MFelix
7 years agoSuper User
Hi Anonymous ,
Try adding the following two columns:
Job title =
CALCULATE (
FIRSTNONBLANK ( 'Employee Dynamic'[Job Title]; 1 );
FILTER (
ALL ( Budget );
Budget[EmployeNumber] = 'Travel 2019'[Employee]
&& 'Employee Dynamic'[Date Start] <= 'Travel 2019'[Date]
&& 'Employee Dynamic'[Date End] >= 'Travel 2019'[Date]
)
)
Budget Group =
CALCULATE (
FIRSTNONBLANK ( 'Employee Dynamic'[Budget Group]; 1 );
FILTER (
ALL ( Budget );
Budget[EmployeNumber] = 'Travel 2019'[Employee]
&& 'Employee Dynamic'[Date Start] <= 'Travel 2019'[Date]
&& 'Employee Dynamic'[Date End] >= 'Travel 2019'[Date]
)
)
Believe the naming of columns is correct should work as expected.
Regards,
MFelix
Anonymous
7 years agoNot applicable
I can understand most of the DAX (Even though I suck at formulating it myself) but I dont Really understand the circled part in this SS. It did return all errors for this one too unfortunately.
-Michael