Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
DJSAM
Frequent Visitor

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:

Model.png

 

The People table looks like this:

People.png

 

The Counties table looks like this:

Counties.png

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:

Measure.png

Thanks!

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

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 

 

SU18_powerbi_badge

 

View solution in original post

2 REPLIES 2
DJSAM
Frequent Visitor

@AlB That did it, thank you!

AlB
Community Champion
Community Champion

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 

 

SU18_powerbi_badge

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.