Forum Discussion
Unable to get LOOKUPVALUE working
I am new to DAX, teaching myself and having trouble with a basic example using LOOKUPVALUE in Power BI Desktop. I know I'm missing something simple but I can't fathom it out. Any help would be much apprecaited.
I have imported two tables from Excel, People and Counties. The only transformation I've made is to use the first row as column names on both tables which I've then saved and closed in the Transform Data window (Power Query Editor).
I want to setup a measure to retrieve the County from the Counties table based on the person's City in the People Table. To keep things simple I've removed the relationship between the tables:
The People table looks like this:
The Counties table looks like this:
When I try to create a new measure on the People Table to retrieve the County from the Counties table I get several errors.
- I set the first value to County in the Counties table as this is the column I want to retrieve.
- I set the second value to City in the Counties table as this is the column I want to search within.
- I set the third value to City in the People table as this is the value I want to use to perform the lookup.
The first error appears in the formula bar, "Cannot find name '[City]'" and I also get an error about a single value for the column City in the table People:
Thanks!
Hi DJSAM
You need a calculated column with that same code in the People table NOT a measure
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers