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
Daniel_Fdrvc
Helper I
Helper I

(V)Lookup only to rows with specific values

Hi all,

 

i've stucked. I have two tables: Table1 and Table2.
In Table2 i have column with values (Table2[Status]) that i need to vlookup to Table1, but only to rows which contains in column Table1[Product] = "Out". If there is other value than "Out" should leave blank. Both tables have same column [ID] to use in vlookup function. No ideas how to do that... Thank you in advance for any suggestions.

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

Hi, @Daniel_Fdrvc 

According to the error message, you can change the measure like this and try if it can work:

Column =

IF(Table1[Product]="Out",

CALCULATE(MAX(Table2[Status]),FILTER(Table2,[ID]=Earlier(Table1[ID])))

,0)

 

If you can not get what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @Daniel_Fdrvc 

According to the error message, you can change the measure like this and try if it can work:

Column =

IF(Table1[Product]="Out",

CALCULATE(MAX(Table2[Status]),FILTER(Table2,[ID]=Earlier(Table1[ID])))

,0)

 

If you can not get what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

Daniel_Fdrvc
Helper I
Helper I

Column = IF(Table1[Product]="Out",LOOKUPVALUE(Table2[Status],Table2[ID],Table1[ID]),0) returns error "a table of multiple values was supplied where a single value was expected"

@Daniel_Fdrvc , seem like there are more than one value in another table.

Try this

 

IF(Table1[Product]="Out", maxx(filter(Table2,Table2[ID]= Table1[ID]),Table2[Status] ) ,0)

 

refer my video on the same : https://www.youtube.com/watch?v=czNHt7UXIe8

 

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.