Reply
Nak000
New Member

Return Values of another table based on Start & End

Hi

 

I have two tables
table 1 - List of contracts containing : 
- Contract ID
- Employee ID
- Start Date
- End Date
Table 2  - timesheet records containing:

- Record Date
- Record ID
- Description
- Value
- Employee ID

 

I am having trouble linking the Contract table to the timesheet table because i can have 2 contracts for 1 employee, and this can vary by date. 
How can i include in the "timesheet records" table the contract ID (as a column) based on start & end Date from table "List of Contracts"?

 

ex:

If i have timesheets for the month of Jan 23, and the contract ID - xx1 has a start date  jan 22 and end date june 23, i need to return xx1 for all record of jan 23 )or any record that falls within this range),
if a new contract for the same employee started in july 23, i need to return for the records of july onwards the contract ID - xx2

Si if employee ID & record Date of timesheet table match employee id & Contract period ==> return contract ID for this period

 

Thank you for your help

1 REPLY 1
lbendlin
Super User
Super User

what if they switch contracts mid month?

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

avatar user

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.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)