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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Making a VLOOKUP-esque column in Power BI

Hi there,

 

I have a large set of data, consisting of migration flows between different jurisdictions.

 

The jurisdictions are denominated by a code, e.g. 'E09000021', of which there are hundreds. Each code corresponds to the name of the jurisdiction, e.g. 'Tower Hamlets' 

 

My source data contains only the codes, and not the names. I would like to include a column in my data that displays the name associated with the code. In Excel this is easily accomplished with a VLOOKUP to a table with all the codes and names side-by-side. 

 

I have tried making a relationship between my data and a lookup table - but i need to be able to export samples from the main dataset *with* the jurisdiction names, so i think i need a column in the main dataset that includes the names.

 

Does anyone know how i could accomplish this?

 

Cheers!

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

You can use LOOKUPVALUE.  In your DetailTable add a calculated column like so:

Jurisdiction Name = LOOKUPVALUE ( NameTable[Jurisdiction Name], NameTable[JurisdictionCode], DetailTable[JurisdictionCode] )

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

Hello @Anonymous 

You can use LOOKUPVALUE.  In your DetailTable add a calculated column like so:

Jurisdiction Name = LOOKUPVALUE ( NameTable[Jurisdiction Name], NameTable[JurisdictionCode], DetailTable[JurisdictionCode] )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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