Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
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]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]
My not working, custom column code ^
"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", which contains the "Standard" column I'm trying to replicate ^
Kind regards,
Jordan
Solved! Go to Solution.
Couldn't fix this in the end, had to use a lookup for a custom column outside of query editor instead.
Couldn't fix this in the end, had to use a lookup for a custom column outside of query editor instead.
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.
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.
What's the error? (Click on the error hyperlink)
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 30 | |
| 28 | |
| 25 | |
| 24 | |
| 16 |
| User | Count |
|---|---|
| 45 | |
| 32 | |
| 17 | |
| 16 | |
| 16 |