Effective date lookup

nileshp

New Member
Joined
Oct 29, 2008
Messages
19
In powerpivot, I have a sales register table with item id. And item weight master with following columns
item id, new wgt, effective date.

Every time weight of item changes, new entry is made in this table with effective date. An item weight can change several times. There is no relationship between these tables as item id can repeat in both tables


I want to grab item weight from item weight master in sales register table considering sales invoice date for effective date.

Hope I am clear
Nilesh
 

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).
An alternative solution uploaded here:
https://www.dropbox.com/s/pfccth7f7ldh8h2/eff date dummy - Owen suggested measure.xlsx?dl=0

I added an Item table and related both Sales and wgt tables to Item, otherwise leaving model unchanged.

The calculated column then becomes:

Code:
=
CALCULATE (
    CALCULATE ( LASTNONBLANK ( wgt[new wgt], 0 ), LASTDATE ( wgt[modify date] ) ),
    'Calendar'[Date] <= EARLIER ( sales[Inv dt] )
)

or

Code:
=
CALCULATE (
    LASTNONBLANK ( wgt[new wgt], 0 ),
    CALCULATETABLE (
        LASTDATE ( wgt[modify date] ),
        'Calendar'[Date] <= EARLIEST ( sales[Inv dt] )
    ),
    ALL ( 'Calendar' )
)

LASTNONBLANK is just there to break ties (which would only happen if you had two different weights for the same item on the same effective date).

Owen :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,724
Members
449,465
Latest member
TAKLAM

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