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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Lookup different value depending on date column

I have a table that shows date of communications actioned (Comms[creation date]), along with the name of the staff member that processed them (Comms[actioned by]). I also have another table showing staff members (Staff[first name]) and the team they work in (Staff[Team]), and a third table that shows the dates a team member was working in a particular team (RoleChange[role start] and RoleChange[role end]). Some staff have moved teams and so the RoleChange table will contain multiple entries for staff members, and no entries for team members that haven't moved.

 

I want to create a calculated column (I think!?) in the communications table that shows the team that the staff member who actioned the communication was working in at the time the communication was actioned. 

 

I've been assuming that I need some kind of LOOKUPVALUE but with variables relating to Comms[creation date] and RoleChange[role start] and RoleChange[role end], but I'm not managing to get anywhere.

 

This is what the relevant section of my model looks like:

 

Annotation 2019-08-16 163238.png

 

Any help much appreciated!

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

this looks a lot like this problem, it has a solution in DAX and Power Query
https://community.powerbi.com/t5/Power-Query/Linking-TimeStamp-to-Value-between-Dates-in-Seperate-Ta...

have a read, and if something is not clear please post again



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

this looks a lot like this problem, it has a solution in DAX and Power Query
https://community.powerbi.com/t5/Power-Query/Linking-TimeStamp-to-Value-between-Dates-in-Seperate-Ta...

have a read, and if something is not clear please post again



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

That's perfect, thanks very much for your help


@Stachu wrote:

this looks a lot like this problem, it has a solution in DAX and Power Query
https://community.powerbi.com/t5/Power-Query/Linking-TimeStamp-to-Value-between-Dates-in-Seperate-Ta...

have a read, and if something is not clear please post again


 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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