cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NitinReja
Regular Visitor

Lookup from another table based on dates

Hi, 
I am trying to automate my invoicing calculation as excel is not able to support the data size. I am using power BI for automating the calculations.

So, problem as under -

I have orders in different dates and different date periods have a different price agreement (depends on sequence number as well - but that is not a big problem).

In excel, we would normally do a filter and assign a price valid on that date to the order rows. This is important as we need to give this backup to our clients for cross verification.

How do we do this in power BI -

 

NitinReja_0-1639037935570.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NitinReja , You can create new column like the one below in Table 1

 

MAxx(filter(Table2, Table1[Collection Date] >= Table2[Date Valid From] && Table1[Collection Date] <= Table2[Date Valid to]), Table2[Price 1St])

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @NitinReja 

It seems that @amitchandak's formula can work for you and I have created an example for your reference.

44.png

 

If it doesn't meet your requirement, please share more details.

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@NitinReja , You can create new column like the one below in Table 1

 

MAxx(filter(Table2, Table1[Collection Date] >= Table2[Date Valid From] && Table1[Collection Date] <= Table2[Date Valid to]), Table2[Price 1St])

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors