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
peterpm
Frequent Visitor

How to contain the LOOKUPVALUE operation to a set of rows with the same ID?

Hi all, I have a few hundred thousand rows with names in two columns.

I'm trying to get the following output:

 

IDNames  Surnames  Unique Names  Unique Surnames  
1Anna  Jorge  Anna  Jorge  
1Richard  Michael    
1Michael  Richard    
2Hammadh  Anna  Hammadh  Anna  

 

I'm using a LOOKUPVALUE formula:

IF(LOOKUPVALUE(Table1[Surnames],Table1[Surnames],Table1[Names])=BLANK(),Table1[Names],BLANK())

 

This works in evaluating the names in the Names column, comparing with the Surnames, and returning the unique values. If there's only 1 single ID.

 

However, I need to contain the operation of the LOOKUPVALUE based on the ID. That way, Anna would show up twice as in the above table, but currently, it doesn't since it ignores IDs and does locate the matching surname on ID: 2

 

How can I contain this LOOKUPVALUE to the rows with the same ID only, as opposed to evaluating the entire column regardless of ID?

 

Thanks!

1 REPLY 1
rubayatyasmin
Super User
Super User

Hi, @peterpm 

 

Add the ID column in the lookup value like this,

 

IF(
LOOKUPVALUE(
Table1[Surnames],
Table1[Surnames], Table1[Names],
Table1[ID], Table1[ID]
) = BLANK(),
Table1[Names],
BLANK()
)

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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