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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors