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
Anonymous
Not applicable

What would be the equivalent of this Lookup formula in PowerBI?

Hi all,

 

I wanted to replicate the data this lookup function in Excel is pulling, into PowerBI.

 

=IFNA(VLOOKUP(M2,Table4[#All],2,FALSE),Q2)

 

For context, M2 is a cell under the column named Project Name, Table 4 is a table that returns a special value if Project Name is detected in it, 2 is where the special value is in Table 4, and Q2 is what I'd like the formula to return if there is an error, which is another line of data.

 

What would be the equivalent of this Excel formula in PowerBI? Thanks!

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

The problem you described is not very clear, maybe you can provide some data or screenshots of the results, which will help us better to deal with the problem .

I created a sample ,maybe you can refer to it .

I created two tables ,table(1) with one value and table(2) with a list of values. And now I want to search in table(2) ,detect whether the value from table(1) in table(2) ,if yes return 2,if no ,return Q2 .

Ailsa-msft_0-1621331000139.png
Ailsa-msft_1-1621331000141.png

So I created a measure:

Measure = IF(SELECTEDVALUE('Table(1)'[Column1]) in ALL('Table (2)'),2,"Q2")

The effect is as shown :

Ailsa-msft_2-1621331000142.png

Best Regards

Community Support Team _ Ailsa Tao

 

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-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

The problem you described is not very clear, maybe you can provide some data or screenshots of the results, which will help us better to deal with the problem .

I created a sample ,maybe you can refer to it .

I created two tables ,table(1) with one value and table(2) with a list of values. And now I want to search in table(2) ,detect whether the value from table(1) in table(2) ,if yes return 2,if no ,return Q2 .

Ailsa-msft_0-1621331000139.png
Ailsa-msft_1-1621331000141.png

So I created a measure:

Measure = IF(SELECTEDVALUE('Table(1)'[Column1]) in ALL('Table (2)'),2,"Q2")

The effect is as shown :

Ailsa-msft_2-1621331000142.png

Best Regards

Community Support Team _ Ailsa Tao

 

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

MFelix
Super User
Super User

Hi @Anonymous ,

 

In Power BI you should use the LOOKUPVALUE you can see the guide and a video with the explanation on how to use the formula in:

 

https://dax.guide/lookupvalue/

 

Without more specific information about your problem is difficult to give you more than this generic link.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.