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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors