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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
lubomir-fischer
New Member

LOOKUPVALUE is always false when searching for an email address

I have 2 tables -
TB_FINAL containing unique information about all users including Email and AccountName.
ForReport containing collumn UserName which containt mixed data - AccountName or Email.
 
example for UserName collumn from ForReport table:
user1
user2
user4
user1
user1
 
I try to use this function to join Email from TB_FINAL table to email at UserName collumn and to return corresponding AccountName.
Test = LOOKUPVALUE('dwh TB_FINAL'[AccountName],'dwh TB_FINAL'[Email],'ForReport'[UserName],"NOPE")
 
Unfortunately all results are NOPE (equivalent to blank in default)
Any help would be appreciated.
 
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @lubomir-fischer 

 

Because multiple rows match the search values, so all results are NOPE.

LOOKUPVALUE function (DAX) - DAX | Microsoft Docs

vchenwuzmsft_0-1638428046867.png

Measure as @Gaurav_Lakhotia  code:

New column :

CALCULATE(MAX('dwh TB_FINAL'[AccountName]),FILTER('dwh TB_FINAL','dwh TB_FINAL'[Email]=EARLIER('ForReport'[UserName]))

 

or 

you can add more condition to LOOKUPVALUE() if there more details to identify which row to match the right result. LOOKUPVALUE() allow users to add multiple conditions to this function.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @lubomir-fischer 

 

Because multiple rows match the search values, so all results are NOPE.

LOOKUPVALUE function (DAX) - DAX | Microsoft Docs

vchenwuzmsft_0-1638428046867.png

Measure as @Gaurav_Lakhotia  code:

New column :

CALCULATE(MAX('dwh TB_FINAL'[AccountName]),FILTER('dwh TB_FINAL','dwh TB_FINAL'[Email]=EARLIER('ForReport'[UserName]))

 

or 

you can add more condition to LOOKUPVALUE() if there more details to identify which row to match the right result. LOOKUPVALUE() allow users to add multiple conditions to this function.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Gaurav_Lakhotia
Helper III
Helper III

Hi @lubomir-fischer, try

CALCULATE(MAX('dwh TB_FINAL'[AccountName]),'dwh TB_FINAL'[Email]=MAX('ForReport'[UserName]))

Or you can also try Related()
Thanks

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.