Lookup Text Value

swingr45

New Member
Joined
Jul 28, 2014
Messages
13
I have what (I think) should be a very simple problem to solve. Still just getting my feet wet with Powerpivot so forgive me...

I have 2 tables, linked by "Entry No."

The first table has Global Dimension 1, Global Dimension 2, Global Dimension 3, Global Dimension 4 fields. The second table has a single "Dimension Value Code" field, with another field denoting the "Dimension Code" which corresponds to Global 1,2,3,4... Using another post, I learned how to bring in the Text Values of the GD1...4
Code:
=IF(COUNTROWS(VALUES(Table[TextColumn])) > 1, BLANK(), VALUES(Table[TextColumn]))

Now I need to bring in the "Dimension Value Code" from the other table so that I can compare them...

Table1:

Entry NoGD1GD2GD3GD4
200000CILGOFCCOACH

<tbody>
</tbody>
Table2:

Entry NoDimension CodeDimension Value Code
200000COMPANYCI
200000DEPARTLG
200000BILLABLEBL

<tbody>
</tbody>
Outcome:
Entry NoGD1GD2GD3GD4COMPANYDEPARTREGIONPRODUCT
200000CILGOFCCOACHCILG

<tbody>
</tbody>
I thought that this formula would work, but I receive an error saying it is invalid:
Code:
LOOKUPVALUE('Table2'[Dimension Value Code],'Table2'[Dimension Code], "COMPANY")


Thanks in advance for the help!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Are you doing this in a calc column? (or a measure / calculated field?)
Can you give us the full error msg?

Just guessing... but maybe you need to also include the entry no in your lookup value so that you get back a unique row?

That, or you really did forget the = at the beginning :)
 
Upvote 0
I'm doing it as a Calculated Field. I wish I had simply forgotten the =, but it is in there, just missed it on the paste.
First I received this error.
pivoterror2.png


After closing and re-opening, the calculated field is available, but when I try to use it, I receive the following error.
pivoterror.png
 
Upvote 0
Ya, pretty sure that is the error you get when you have not uniquely identified the row. (There are multiple rows with Dimension Code = "Company").
 
Upvote 0
Correct. There are going to be lots of Entry No's with a "COMPANY", a "DEPART, etc... So I thought that in the Pivottable, if I selected Entry No as the Rows, the Calculated Field would factor that in... is that incorrect? Each Entry No. will have at max, 1 of any particular Dimension Code.

to give an expanded snapshot of my previous one:

Entry NoDimension CodeDimension Value Code
200000COMPANYCI
200000DEPARTLG
200000BILLABLEBL
200001COMPANYCS
200001DEPARTIT
200001PRODUCTCOACH
200002COMPANYCS
200002DEPARTIT
200002PRODUCTSCAN
200003COMPANYLS
200003DEPARTLG
200003PRODUCTCOACH
200004COMPANYLS
200004DEPARTIT
200004BILLABLENB

<tbody>
</tbody>
 
Upvote 0
I admit to not finishing my first cup of coffee yet, so I am not SUPER sure what you are trying to do. Do these two tables have a relationship?

Maybe something like this would work for you?
=LOOKUPVALUE('Table1'[Dimension Value Code],'Table1'[Dimension Code], "COMPANY", Table1[Entry No], MAX(Table2[Entry No]))
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,467
Members
448,965
Latest member
grijken

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