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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Retrieve value from another table based on a date

Hi,

 

I have 2 tables.

 

In table 1 (hours) I have a row with a hour_date column and an card_id column

In table 2 (salaries) I have a row with a start_date column, end_date column, salary_rate and a card_id column

 

Both tables have multiple rows with the same card_id.

  eg. card_id 1 can have multiple hours rows as they have worked several times a week.
  card_id 1 can have multiple salaries rows as they have a different salary at different dates

 

The goal is to have the right salary_rate in every hours row in table 1, obviously taken from table 2. Where the hour_date from table 1 should be same as or before the end_date from table 2.

 

I'd like the result to be put in table 1. That way, each row in table 1, has the correct salary_rate

 

I can't seem to figure out how.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

try to add a column in this way:

 

 

image.png

 

 

 

 

I still have some doubts as to whether the start_date information from the salary table is not used.

 

 

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

If Rocco_sprmnt21's answer sloves your problem , could you kindly accept it as a solution to close this case and help the other members find it more quickly?
If not, please feel free to let me know.
 
Best Regards
Maggie
Anonymous
Not applicable

Hi,

 

Thanks for the provided solution, I will test it soon and will accept it when it's proven it worked. Will get back to it asap

Anonymous
Not applicable

try to add a column in this way:

 

 

image.png

 

 

 

 

I still have some doubts as to whether the start_date information from the salary table is not used.

 

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Top Solution Authors