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
achurk
Frequent Visitor

Search one table to return value from corresponding column

Hello!

 

I have two data files "schedule_data" and "production_data"

 

schedule_data has both columns lot_number (example format 12345, 23456, 34567, etc) and batch_size (example format 1, 8800, 550, etc), while production_data only has lot_number.

 

The lot numbers in production_data are the same as the lot numbers in schedule_data but in a different order.

 

My goal is to create 2 table visualizations in my power bi dashboard. One with the columns from schedule_data: lot_number, batch_size and another with the columns from lot_number from production_data and batch size from schedule_data.

 

Is there a way to get the visualization to look up the batch_size from schedule_data and create a batch_size column for the lot numbers in production_data? Either in a table or in a visualization? I cant get them to match up correctly

 

Thank you!

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

Hi @achurk ,

 

I have built a simply data sample:

Eyelyn9_3-1638515086523.png

 

  • Method1—— You could build a relationship based on lot_number between these two tables:

Eyelyn9_4-1638515184679.png

 

 

  • Method2—— Use LOOKUPVALUE() if there is a unique batch_size of each lot_number:
Searched = LOOKUPVALUE(schedule_data[batch_size ],schedule_data[lot_number],'production_data'[lot_number])

Eyelyn9_1-1638514696051.png

Eyelyn9_0-1638514618555.png

 

 

Best Regards,
Eyelyn 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

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @achurk ,

 

I have built a simply data sample:

Eyelyn9_3-1638515086523.png

 

  • Method1—— You could build a relationship based on lot_number between these two tables:

Eyelyn9_4-1638515184679.png

 

 

  • Method2—— Use LOOKUPVALUE() if there is a unique batch_size of each lot_number:
Searched = LOOKUPVALUE(schedule_data[batch_size ],schedule_data[lot_number],'production_data'[lot_number])

Eyelyn9_1-1638514696051.png

Eyelyn9_0-1638514618555.png

 

 

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

amitchandak
Super User
Super User

@achurk , You can but that might not be accurate, It can be Min/Max or Average of Size in another table for same lot number, if there is more than one size for the same lot number

a new column in production_data 

 

batch_size = Maxx(filter(schedule_data , production_data[lot_number]   =schedule_data [lot_number] ), schedule_data [batch_size] ) 

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.