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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
vpsoini
Helper I
Helper I

Add delivery time per product into orders?

Hi.

 

I have two tables. First one (orders) has information about sales order dates, products (item number, description) and customer and second one (products) has the product info, including the expected delivery time per product. So

 

Table "orders" looks like this:

 

SO number - Orderdate - ItemNo - Description - Quantity - Customer

SO001 - 20/08/2021 - Item001 - Desc001 - 2 - customer A

SO002 - 01/09/2021 - Item002 - Desc002 - 1 - customer B

SO003 - 03/09/2021 - Item003 - Desc003 - 3 - customer C

SO004 - 19/09/2021 - Item001 - Desc001 - 1 - customer D

 

And "products" like this

ItemNo- Balance - deliverytime (w) - deliverytime (d)

Item001 - 1 - 2 - 14

Item002 - 0 - 4 - 28

Item003 - 5 - 1 - 7

 

These tables have relationship based on the ItemNo.  So each item has it's own delivery time, which should be added to order time on the fly to get ETA for the delivery

 

What I would like to achieve, is to get a new column to the orders table, where delivery time from "product" table is added to the order date to generate ETA for delivery and another column to justify (true/false) if that calculated date is already missed (failed to deliver in time compared to TODAY). In my example it would look like:

 

SO001 - 20/08/2021 - Item001 - Desc001 - 2 - customer A - 03/09/2021 - Delayed

SO002 - 01/09/2021 - Item002 - Desc002 - 1 - customer B - 29/09/2021 - OK

SO003 - 03/09/2021 - Item003 - Desc003 - 3 - customer C - 10/09/2021 - Delayed

SO004 - 19/09/2021 - Item001 - Desc001 - 1 - customer D - 17/10/2021 - OK

 

I tried to get that with DATEADD - function, but PowerBI didn't "find" any columns from Product-table 

 

1 ETA = DATEADD('Orders[Orderdate],' *here I could only select columns from my Orders-table*...

 

Any help is much appreciated. 

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@vpsoini Try:

Column = [Orderdate] + RELATED('products'[delivertime (d)])

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
vpsoini
Helper I
Helper I

That did the trick. Thanks! 🙂

Greg_Deckler
Super User
Super User

@vpsoini Try:

Column = [Orderdate] + RELATED('products'[delivertime (d)])

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.