Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
(Simplified) I have 2 tables and want to look-up the charge out rate applicable for each member of staff, based on the invoice date:
Table 1:
Col A: invoice date
Col B: employee
Col C: I want to look up their charge out rate applicable for when the job was done
Table 2:
Column A: employee
Column B: date
Column C: rate
Table 2 Example:
Col A.....Col B.....Col C
John 15/01/2022. 100
John 03/07/2022. 120
Here you see that John's charge out rate is £100 from 15/01/2022 to 02/07/2022 where it then changes to £120
Is there a way of working this out the rate or does Table 2 need to include all dates in order to find a match ?
Solved! Go to Solution.
Hi, @AndyDD_UK
Please try formula like below:
Look_up_date =
CALCULATE (
MAX ( Table2[invoice date] ),
FILTER (
ALL ( Table2 ),
Table2[invoice date] <= MAX ( Table1[invoice date] )
&& Table2[employee] = MAX ( Table1[employee] )
)
)
Look_up_rate =
CALCULATE (
MAX ( Table2[Rate] ),
FILTER (
Table2,
Table2[employee] = MAX ( Table1[employee] )
&& Table2[invoice date] = [Look_up_date]
)
)
Best Regards,
Community Support Team _ Eason
Hi, @AndyDD_UK
Please try formula like below:
Look_up_date =
CALCULATE (
MAX ( Table2[invoice date] ),
FILTER (
ALL ( Table2 ),
Table2[invoice date] <= MAX ( Table1[invoice date] )
&& Table2[employee] = MAX ( Table1[employee] )
)
)
Look_up_rate =
CALCULATE (
MAX ( Table2[Rate] ),
FILTER (
Table2,
Table2[employee] = MAX ( Table1[employee] )
&& Table2[invoice date] = [Look_up_date]
)
)
Best Regards,
Community Support Team _ Eason
@AndyDD_UK , Based on what I got.
You need a new column first
end Date = minx(filter(Table, [Name] = earlier([Name]) && [Date] > earlier([date])), [Date]) -1
Then use the logic in blog or file to expand
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
10 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |