Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
GiantPygmy
Regular Visitor

relating tables based on multiple column criteria

I have an issue of needing to get data from one table onto another based on multiple column conditions.   I have a Completed Tasks table that has the User ID of the person who completed the task, a Task Identifier Number, the date the task was created, and the date it was completed.  I then have a Users Table that has the User ID, The department they work for, a Begin Date they started that department, and an End Date for when they left that department.   The issue is that on the user table the User ID will be duplicated several times as a person has changed departments.  My ultimate goal is to have a way to track their on time completion (for example task completed in 1 day) based on department and not user.   Since a user can change departments I will have to account for what department that user was in at the time of completion of the task.

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @GiantPygmy,

Could you please post me some sample data to have a test and your desired result?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

*UPDATE* lol NM, I figured out a solution (just to let you know i created a unique key based on user id and Date combo and tied it with that).  Feel silly now that I figured that out but couldn't find a way to delete the post.

 

Sorry about that.  Here are examples of tables I'm working with.

Task Table:

TaskIDUserIDCreateDateCompleteDate
546316345/1/20175/3/2017
546326345/2/20175/2/2017
546322818/18/20178/25/2017
5463235611/21/201712/3/2017
5463228112/1/201712/17/2017
546326341/7/20181/8/2018
546323562/13/20182/28/2018

 

User Table:

*Note* I do have a another table like this but instead of a StartDate and EndDate it has a single Date column with all the dates inbetween listed individually.

UserIDDepartmentStartDateEndDate
634Warehouse4/1/201712/1/2017
634Clerk12/2/20175/1/2018
281Floor4/1/201712/1/2017
281Warehouse12/2/20173/1/2018
281Clerk3/2/20185/1/2018
356Clerk6/1/20171/1/2018
356Floor1/2/20185/1/2018

 

Ultimate goal is to have it display the total tasks completed by each department by Year and Month:

 Mar 17Aug 17Dec 17Jan 18Feb 18
Warehouse20100
Floor01001
Clerk00110

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.