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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Etx
Microsoft Employee
Microsoft Employee

LOOKUPVALUE error confusingly occurs in one formula, but not other identical formulas

I'm very new to PowerBI, and having trouble getting a DAX formula to work correctly. In addition to helping fix the problem, I'm also open to suggestions on how to make a better formula in general, in case you think it looks a little inelegant ๐Ÿ™‚  

 

I have 3 tables: Table1, Table2, and Table3. Each table has 3 columns, but I only care about the first column, called [Name]. The [Name] column has no duplicates within a table, but there can be the same [Name] in 2 or more Tables. The tables are not related to each other.

So for example:

 

Table 1

Name*

1stName

2ndName

3rdName

 

Table 2

Name*

1stName

2ndName

4thName

 

Table 3

Name*

1stName

3rdName

5thName

 

I want to create a single table that lists all the [Name]s from each table once in the first column, and then 3 boolean columns which say whether the exact [Name] can be found in that table. For example:

 

BoolTable

AllNames*

InTable1?

InTable2?

InTable3?

1stName

TRUE

TRUE

TRUE

2ndName

TRUE

TRUE

FALSE

3rdName

TRUE

FALSE

TRUE

4thName

FALSE

TRUE

FALSE

5thName

FALSE

FALSE

FALSE

 

For the 'BoolTable'[AllNames] column, I made a DISTINCT UNION of the 3 original tables from their [Name] columns.

Then, I made calculated columns for each of the 3 tables:

 

 

 

InTable1? = IF(Not(ISBLANK(LOOKUPVALUE('Table1'[Name],'Table1'[Name],'BoolTable'[AllNames]))),true,false)

 

 

 

 

InTable2? = IF(Not(ISBLANK(LOOKUPVALUE('Table2'[Name],'Table2'[Name],'BoolTable'[AllNames]))),true,false)

 

 

 

 

InTable3? = IF(Not(ISBLANK(LOOKUPVALUE('Table3'[Name],'Table3'[Name],'BoolTable'[AllNames]))),true,false)

 

 

 

 

 

So, basically, each calculated column will look in each 'BoolTable'[AllNames] row and compare the 'TableX'[Name] value in their respective table, and return that 'TableX'[Name] (I don't actually care what it returns, just if it is found in that table or not).

 

The calculated columns 'BoolTable'[InTable2?] and [InTable3?] work perfectly fine, and don't give errors. However, [InTable1?] will give the following error: "A table of multiple values was supplied when a single value was expected"โ€ฆ and then it breaks all my measures and visuals.

 

I don't understand why this happens, because A. There are no duplicate values in 'Table1'[Name], and B. It works perfectly in the other 2 calculated columns.

 

Any advice?

 

Thank you,

Ethan

1 ACCEPTED SOLUTION
Etx
Microsoft Employee
Microsoft Employee

Thanks everyone for your help!

 

Ultimately, I found the solution to my problem in this thread.

 

TL;DR, because the LOOKUPVALUE was finding duplicate values in the destination column (for some reason?), I had to use FIRSTNONBLANK()

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Etx , You have union distinct names from all table. In power query append and delete duplicates. In DAX Distinct and union

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

 

 

In dax you have following was to get data from one table to another

https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Etx
Microsoft Employee
Microsoft Employee

Thanks everyone for your help!

 

Ultimately, I found the solution to my problem in this thread.

 

TL;DR, because the LOOKUPVALUE was finding duplicate values in the destination column (for some reason?), I had to use FIRSTNONBLANK()

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (25)