Lookup With Multiple Criteria in PowerPivot

rksample

New Member
Joined
Oct 13, 2010
Messages
47
Hi Gurus,

I have a query to solve in Power Pivot. Seems like a small formula in Excel, I am unable to crack it on Power Pivot.

I have 2 tables.
Table1: ID, DateIn, DateOut, Value
Table2: ID, DateAsOn

There are multiple values for the Same ID, but falls in different DateRange (DateIn - DateOut)

I need a DAX formula which can lookup in the Table1 and fetch me the Value specific to an ID on that Particular Date.

Something like this criteria:
1. Table1.ID = Table2.ID
2. Table1.DateIn <= Table2.DateAsOn
3. Table1.DateOut >= Table2.DateAsOn

Please help me on this trick.

Thank you,
Ravi.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
It's going to depend a bit on where you want to use this, if there are dupes, and if you want a measure vs calculated column, but... it will probably look something like...

=CALCULATE(MIN(Table1[Value]), FILTER(Table1, Table1.Id = MIN(Table2.ID) && Table1.DateIn <= MIN(Table2.DataAsOn) && Table1.DateOut >= MIN(Table2.DateAsOn))
 
Upvote 0
Thanks Scottsen for formula. I shall try this first thing morning.

And to answer you, yes there were duplicates (ID-Value combinations). Though ID-Value-DateIn-DateOut combination will be unique :) So for any specific Date an ID as one specific value which is to be Fetched.

Thanks again, will keep you posted on the result.

Cheers,
Ravi.
 
Upvote 0

Forum statistics

Threads
1,224,065
Messages
6,176,169
Members
452,710
Latest member
mrmatt36

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top