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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jcawley
Helper III
Helper III

New to BI, VLookup alternative?

Hello,

 

I'm new to Power BI and trying to... Make a V-Lookup of sorts. How can I create a column that looks to see if a value on table1 appears in a table2 in a different column? I just would like it to return "Yes" or "No" depending if the value exits.

Table1

IDID Exists in Table2?
12345 
23456 

 

Table2

 

Exchange IDID
1111112345

 

Any help would be greatly appreciated

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jcawley , A new column in Table 1,

 

In case tables are related 1-M from Table1 to table 2

if(isblank(realted(Table2[ID])),"No", "Yes")

 

Or

 

if(isblank(countx(filter(Table2, Table2[ID] =Table1[ID]),Table2[ID])),"No", "Yes")

View solution in original post

5 REPLIES 5
amaleranda
Post Patron
Post Patron

@jcawley ,

 

Below is calcualted column is based on one to many relationship based between Tabel1(One) and Tabel 2(Many).

 

Please accepet it as a solution if it fits your requirment.

 

Answer1.PNG

amitchandak
Super User
Super User

@jcawley , A new column in Table 1,

 

In case tables are related 1-M from Table1 to table 2

if(isblank(realted(Table2[ID])),"No", "Yes")

 

Or

 

if(isblank(countx(filter(Table2, Table2[ID] =Table1[ID]),Table2[ID])),"No", "Yes")

Thank you! The second one worked for me.

az38
Community Champion
Community Champion

Hi @jcawley 

LOOKUPVALUE() https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

or calculate countrows. in your case it will be like

Column = 
var _isValue = CALCULATE(COUNTROWS(Table2), FILTER(Table2, Table2[ID] = EARLIER(Table1[ID])) )
RETURN
IF(_isValue > 0, "yes", "no")

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank you! This solution worked for us as well!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.