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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Custom Column Lookup Help

Hi all,

 

I'm currently following this guide (https://community.powerbi.com/t5/Desktop/How-to-lookup-values-in-another-table-in-the-Query-Editor/t...to create a custom column that functions as a lookup for "Standard" in edit query. 

 

In the example, they use the code below, which works.

(let currentCustomer = [CustomerName] in Table.SelectRows(Table1, each [CustomerName] = currentCustomer)){0}[CustomerID]

image.png

Example in guide ^ 

 

However when I replicate this with my two tables, it returns errors. Has anyone got a clue why? 

 

(let currentTaskType = [TaskType] in Table.SelectRows(#"Post and Diary Key", each [TaskType] = currentTaskType)){0}[Standard] image.png

My not working, custom column code ^ 

 

"Claims Post and Diary" Query"Claims Post and Diary" Query

"Claims Post and Diary", where I am adding the custom column ^

 

"Post and Diary Key" Query"Post and Diary Key" Query

"Post and Diary Key", which contains the "Standard" column I'm trying to replicate ^

 

Kind regards,

 

Jordan

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Couldn't fix this in the end, had to use a lookup for a custom column outside of query editor instead.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Couldn't fix this in the end, had to use a lookup for a custom column outside of query editor instead.

Anonymous
Not applicable

 

 

File in link @HotChilli @v-eachen-msft 

 

Thanks for the quick response! 

We can't access the source data (that's by design, we don't have access to local files on your system), however, messing around with the data and trying out the M, it looks like the error is 

"There weren't enough elements in the enumeration to complete the operation." or to translate, we can't find this value in the other file.

This will be for 2 reasons, either the value can't be found because there are differences in case (all the TaskType values are Upper Case) or it just doesn't exist in the other table.

 

 

v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you please share your sample data here if you don't have any Confidential Information? Please upload your files to OneDrive for Business and share the link here.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
HotChilli
Super User
Super User

What's the error?  (Click on the error hyperlink)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors