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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Power Query: Conditional Merge / Lookup or Something Else?

I have a Reported Issues table as a fact table and an Employee Data table as a dimension table. We refresh the model weekly; new issues are added and previous issues get updated. We also receive a new Employee Data file monthly which overwrites the previous file. 

 

Both tables have an Employee ID field. I want to merge the Employee Department into the Reported Issues table. That is simple enough under normal circumstances. However, there is a catch: after an issue is closed, the Employee Department needs to remain static. We don't want a closed issue to "follow" the employee should they change departments in the future; the issue should remain with the department where the employee was working when they reported the issue.

 

Any ideas on how to accomplish this in Power Query? I'm thinking there must be a way, either using conditional merges, reference tables, or a combination of the two. I could be wrong. 

1 REPLY 1
olgad
Resident Rockstar
Resident Rockstar

Hi Andrew, what is the source for the Employee file??

If the file gets overwritten with the new data, there is no way to say which department person belonged to at the time of closing the issue. So you have to introduce historisation for your employees which might be in a form of storing those monthly files with a stamp of a period or you might have a history with valid from valid to columns, just for those entries where employees change departments.  And then you would merge not only on the employee id, but employee id plus the effective period on the employee data side and employee id plus the period of the issue opened/closed whatever is the leading date there. 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.