March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
Having an issue figuring out how to gather information from a seperate table comparing two different columns. Below are examples of tables. Case Table holds all cases with the date the case was made and the email of who made it. While the Department table has the dates the employee was hired/changed departments (Job Date), the employee's email, and the current department the employee is in.
Case Table
Case | Date Created | Department | |
1 | 7/13/19 | John@job.com | |
2 | 1/5/18 | Joe@job.com | |
3 | 10/10/19 | John@job.com |
Department Table
Job Date | Employee Email | Current Department |
5/5/18 | John@job.com | Customer Service |
7/10/19 | John@job.com | Operations |
10/9/19 | John@job.com | Finance |
1/1/18 | Joe@job.com | Customer Service |
I am trying to get the Current Department the employee was in at the time the case was created. Below is example of what completed case table would look like
Completed Case Table
Case | Date Created | Department | |
1 | 7/13/19 | John@job.com | Customer Service |
2 | 1/5/18 | Joe@job.com | Customer Service |
3 | 10/10/19 | John@job.com | Finance |
I had tried using FirstNONBLANK, but cannot work a filter to compare the dates and pull the correct department.
Department =
CALCULATE(
FIRSTNONBLANK(DepartmentTable[CurrentDepartment], 1),
FILTER(
DepartmentTable,
DepartmentTable[Employee Email] = CaseTable[Email]
&& AssociateLog[ModifiedDate] <= Complaints[Date]
)
)
Solved! Go to Solution.
Hi @Anonymous
try this calculated column
Department = lookupvalue(DepartmentTable[Current Department];DepartmentTable[Employee Email];[Email];DepartmentTable[Job Date];calculate(max(DepartmentTable[Job Date]);filter(all(DepartmentTable);DepartmentTable[Employee Email]=[Email] && DepartmentTable[Job Date]<=[Date Created])))
do not hesitate to give a kudo to useful posts and mark solutions as solution
this worked like a charm for me! thank you!
Hi @Anonymous
try this calculated column
Department = lookupvalue(DepartmentTable[Current Department];DepartmentTable[Employee Email];[Email];DepartmentTable[Job Date];calculate(max(DepartmentTable[Job Date]);filter(all(DepartmentTable);DepartmentTable[Employee Email]=[Email] && DepartmentTable[Job Date]<=[Date Created])))
do not hesitate to give a kudo to useful posts and mark solutions as solution
Hi @az38
That worked perfect! Originally tried using Lookupvalue, but had no luck. Thank you!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
26 | |
21 | |
20 | |
14 | |
10 |