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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Kfausch
Helper II
Helper II

Look up value formula

Hello,

 

Below is an example if the data I am working with. I am in a manufacturing setting, where 1 document has two entry types; output and consumption. The column called "Output Lot No." is what I am trying to do in Power BI. Essentially I am looking for a formula that will look up the lot number used for output and apply it to all lines with the same Document No. but I cannot find anything that works.

 

Power BI.PNG

 

Any help would be greatly appreciated!

Kevin Fausch

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try

new Column =
LOOKUPVALUE('Table'[Lot No.], 'Table'[Entry Type], "Output", 'Table'[Document No.], firstnonbank('Table'[Document No.],true()))
OR
new Column =
minx(filter('Table', 'Table'[Entry Type]= "Output" && 'Table'[Document No.]= earlier('Table'[Document No.])),'Table'[Lot No.])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Try

new Column =
LOOKUPVALUE('Table'[Lot No.], 'Table'[Entry Type], "Output", 'Table'[Document No.], firstnonbank('Table'[Document No.],true()))
OR
new Column =
minx(filter('Table', 'Table'[Entry Type]= "Output" && 'Table'[Document No.]= earlier('Table'[Document No.])),'Table'[Lot No.])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Great the second formula worked! Thank you!!

 

test lot = minx(filter('ILE - Production', 'ILE - Production'[Entry_Type]= "Output" && 'ILE - Production'[Document_No]= earlier('ILE - Production'[Document_No])),'ILE - Production'[Lot_No])

az38
Community Champion
Community Champion

Hi @Kfausch 

try a column

Column =
LOOKUPVALUE('Table'[Lot No.], 'Table'[Entry Type], "Output", 'Table'[Document No.], [Document No.])

 

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


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

I am getting this error "A table of multiple values was supplied where a single value was expected." I think its because the table has multiple production Document No.'s.

Power BI2.PNG

 

Thanks for you input!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors