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

Having trouble with Lookup

In trying to use the Lookup funtion, I believe I am doing something incorrectly.  

 

My expected outcome is that from within my Orders table, I want to "lookup" the ship date from my Shipments table, and then create a column for "ship date" on my Orders table.  (no direct relation ship but both are connected to a date table.    

 

Right now, a column is being created  (ship date month), but it seems to be grabbing the "due date" from my Orders table.  

 

If the ship date for a particular order is in the future and has not happened yet, I would like the ship date column to return a ZERO. 

 

(I beleive the same thing is happning with my formula for est close month).    The Order Date and Due Date columns already exist on my orders table.  

 

How can I bring in, and put in a column, the "est close dates" from my Shipments table?  

 

Ship Date Month =
LOOKUPVALUE ( 'Flu_Shipped Orders'[Date Shipped Month], 'Flu_Shipped Orders'[Date Shipped Month], Sales_Orders_for_Charts[Due Date Month])
 
if then .png
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

I think you should move the date based on order no or something like that. Another way to get a column from one table 2 to table 1

New Column = maxx(filter(table2,table2[Col1]= table1[col1] && table2[Col2]= table1[col2] ),table2[required_col])

 

Refer to the order dimension in this file. it has an example

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,

I think you should move the date based on order no or something like that. Another way to get a column from one table 2 to table 1

New Column = maxx(filter(table2,table2[Col1]= table1[col1] && table2[Col2]= table1[col2] ),table2[required_col])

 

Refer to the order dimension in this file. it has an example

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

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.