cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel_Fdrvc
Frequent Visitor

(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.

View solution in original post

Daniel_Fdrvc
Frequent Visitor

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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors