LOOKUPVALUE -- Recreate VLOOKUP getting 1st and 2nd matching value in DAX

nikkollai

New Member
Joined
Sep 10, 2014
Messages
49
Hello Everyone,

I tried this for a few hours and officially give up. It would be great if someone could look at this with fresh mind and figure it out.


So, I have two table that are linked with bridge table and I am trying to pull cost prices from cost table into price table through LOOKUPVALUE DAX function.

LOOKUPVALUE(CostTable[Cost], CostTable[Product_ID], ProductTable[ProductID])

The problem is that I have same values for cost and DAX is throwing an error. Cost is different for every month (3rd column), so my goal is to re-create a vlookup first (cost) and second (month) matching values. The challenge is to filter CostTable[Month] inside a lOOKUPVALUE function. IT's ok to hardcode the number of the month inside the LOOKUPVALUE function.

If you have any ideas I will be highly thankful.


COST TABLE

Product_IDCostMonthYear
1516554 195.80 52016
1516583 194.80 62016
1516594 194.80 42016
1516560 194.07 32016
1516561 193.99 12016
1516571 193.87 42016
1516519 193.87 62016
1516530 193.86 52016
1516589 193.85 32016
1516533 193.84 22016
1516521 193.79 32016
1516569 193.21 52016
1516591 192.50 52016
1516586 192.50 42016
1516534 192.50 32016
1516518 192.50 22016
1516547 192.50 62016

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>


PRODUCT TABLE

Product_IDCost
1516554 value for 6 month
1516583 value for 6 month
1516594 value for 6 month
1516560 value for 6 month
1516561 value for 6 month
1516571 value for 6 month
1516519 value for 6 month
1516530 value for 6 month
1516589 value for 6 month
1516533 value for 6 month
1516521 value for 6 month
1516569 value for 6 month

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Power pivot is different to Excel, and I am guessing you are going about this the wrong way. Can you post a sample workbook with all 3 tables loaded? Providing info on just 2 of the 3 tables makes it difficult to help you.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,841
Members
449,471
Latest member
lachbee

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