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
willboyes
Frequent Visitor

Replicating vlookup in same table

Hi - apologies if I'm missing something really obvious here, but I'm struggling to replicate a Vlookup in Power BI.

 

I have a table with 3 columns, the first is a consecutive ID value for each row, the second is a text string, and the third is another set of IDs which reference the first column.  I need to add another column which shows the text string from the second column, where the IDs in the first and third columns match. This is a simple Vlookup in Excel...

 

This table uses data from a Sharepoint Task app. The third column uses IDs to reference task hierarchy within a list, e.g. a task begins with one entry and then multiple sub-tasks, each referencing the first task. The data from Sharepoint only provides IDs, whereas I need to use the text strings (task names) in my report.

 

Any help would be much appreciated! Thanks

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

@willboyes

 

Try this Column

 

Column =
LOOKUPVALUE ( [Text String], [ID], [ID 2] )

lkup.png


Regards
Zubair

Please try my custom visuals

View solution in original post

@willboyes

 

With Power Query, you can do a self merge of the Table

 

lkup1.png

 


Regards
Zubair

Please try my custom visuals

View solution in original post

6 REPLIES 6
Zubair_Muhammad
Community Champion
Community Champion

@willboyes

 

Try this Column

 

Column =
LOOKUPVALUE ( [Text String], [ID], [ID 2] )

lkup.png


Regards
Zubair

Please try my custom visuals

Thanks very much - that's working now, not sure what I was doing wrong before!

If I wanted to replicate that approach in the query editor, how could I go about it?  

@willboyes

 

With Power Query, you can do a self merge of the Table

 

lkup1.png

 


Regards
Zubair

Please try my custom visuals

Hello,

 

I have a similar situation within a table that has a lot of columns and data also coming from other tables in a pretty complex model.

 

When I add that Merge step, followed by an Expand step, it causes my refresh to get hung and my report will no longer update.

 

I tried creating a simplified copy of the table to Merge and Expand from, but I am still running into the same issue.  

 

Any idea/suggestion?

Brilliant - worked first time!

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.