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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

LookupValue not doing what I expected

I have two tables, one containing a list of Accounts and the other containing a list of Transactions.  

 

Accounts:

AccountIDName
0014J00000TY6bJQATJoes Sub Shop
0014J00000YMuK1QALBill Boots Barn
0014J00000YMuh8QADJohns Jumpsuits
0014J00000TYcRxQALSallys Safes
0014J00000TYdxXQATToms Turkeys
0014J00000TYeXWQA1Larrys Leggings
0014J00000TYep2QADDons Donuts
0014J00000TYfisQADPaulas Pencils
0014J00000TYGxPQAXEthans Elephants
0014J00000TXwnyQADHelens Helmets
0014J00000TXrpVQATWalters Wafers

 

Transactions:

TransIDAccountIDReferringAccount
1000101010014J00000TY6bJQAT0014J00000TYGxPQAX
1000101020014J00000YMuK1QAL0014J00000TXwnyQAD
1000101030014J00000YMuh8QAD0014J00000TXrpVQAT
1000101040014J00000TYcRxQAL 
1000101050014J00000TYdxXQAT 
1000101060014J00000TYeXWQA1 
1000101070014J00000TYep2QAD 
1000101080014J00000TYfisQAD 

 

In the data view, I have created a new column in the Transactions table using the following:

 

ReferringAccountName = LOOKUPVALUE(Accounts[AccountID],Accounts[Name],Transactions[ReferringAccount],"None")
 
My resulting data looks like this when I display it in a table visualization:
 
TransIDAccountIDReferringAccountReferringAccountName
1000101040014J00000TYcRxQAL  
1000101050014J00000TYdxXQAT  
1000101070014J00000TYep2QAD  
1000101060014J00000TYeXWQA1  
1000101080014J00000TYfisQAD  
1000101030014J00000YMuh8QAD0014J00000TXrpVQATNone
1000101020014J00000YMuK1QAL0014J00000TXwnyQADNone
1000101010014J00000TY6bJQAT0014J00000TYGxPQAXNone

 

I expected the table visualization to contain

 
TransIDAccountIDReferringAccountReferringAccountName
1000101040014J00000TYcRxQAL None
1000101050014J00000TYdxXQAT None
1000101070014J00000TYep2QAD None
1000101060014J00000TYeXWQA1 None
1000101080014J00000TYfisQAD None
1000101030014J00000YMuh8QAD0014J00000TXrpVQATWalters Wafers
1000101020014J00000YMuK1QAL0014J00000TXwnyQADHelens Helmets
1000101010014J00000TY6bJQAT0014J00000TYGxPQAXEthans Elephants

 

What am I doing wrong?

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , I think it should

ReferringAccountName = LOOKUPVALUE(Accounts[Name],Accounts[AccountID],Transactions[ReferringAccount],"None")
 
or try like
Maxx(filter(Accounts,Accounts[AccountID] = Transactions[ReferringAccount] ), Accounts[Name])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , I think it should

ReferringAccountName = LOOKUPVALUE(Accounts[Name],Accounts[AccountID],Transactions[ReferringAccount],"None")
 
or try like
Maxx(filter(Accounts,Accounts[AccountID] = Transactions[ReferringAccount] ), Accounts[Name])
Anonymous
Not applicable

Thanks!  The first suggestion worked on the sample I provided (except those that didn't have a match were left blank instead of saying "none").  However, when I applied it to my real world case, it did not work.  Good news though, the second suggestion worked both times.  Thank you for the quick reply and suggestion. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.