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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
mussaenda
Super User
Super User

One Order Date with Multiple Shipment Dates

I am a newbie in power bi and I am dealing with some problems.

 

I have 3 tables: Sales Table, Shipment Table, and Date Table.

In Sales Table, I have the the Order Date, Job Number, the Qty of the Order.

In Shipment Table, I have the Shipment Date, Job Number, the Qty of the Order shipped.

 

Sales Table

Sales Table.png

 

Shipment Table

 

Shipment Table.png

 

The scenario is, for some orders, there are multiple shipments made.

For example:

 

Job Number        Order Date          Qty of Order        Shipment Date        Qty of Order Shipped

1180001               1/1/18                  100,000               1/25/18                    25,000

                                                                                     2/10/18                    25,000

                                                                                     2/15/18                    25,000

                                                                                     3/31/18                    25,000

 

My problem is I cannot merge the 2 tables because when I tried, the qty of the order is duplicating based on the number of rows of the shipment table via job number.

 

What I needed is to calculate is the Open Quantity of Orders.

 

Month       Job Number       Qty Open

   1               1180001          75,000

   2               1180001          25,000

   3               1180001            0

 

 

Also, I need to track all the open orders of the previous years by week/month.

 

I tried to put the shipment date to the Sales Table and tried the formula below that I got here but it counts the qty as whole until reaching the final shipment date.

 

General Orders 2 = 
CALCULATE (
    [Total Weight],
    FILTER (
        GENERATE (
            SUMMARIZE (
                CALCULATETABLE('LTC ME$Sales Line New', ALL('Date Table')), 
                'LTC ME$Sales Line New'[LTC ME$Sales Header.Order Date],
                'LTC ME$Sales Line New'[Shipment Date]
            ),
            DATESBETWEEN (
                'Date Table'[Date],
                'LTC ME$Sales Line New'[LTC ME$Sales Header.Order Date],
                'LTC ME$Sales Line New'[Shipment Date]
            )
        ),
        CONTAINS ( VALUES ( 'Date Table'[Date] ), [Date], 'Date Table'[Date] )
    ),
    
	CROSSFILTER('Date Table'[Date], 'LTC ME$Sales Line New'[LTC ME$Sales Header.Order Date], None)
)

Total Weight is the Sum of Qty from Sales Table.

 

I've been dealing with this for over a week now. I hope someone will help me solve this problem.

 

Thank you,

Mussaenda

 

 

 

8 REPLIES 8
Anonymous
Not applicable

HI @mussaenda,

 

Please share some sample data for test to coding formula.

 

Regards,

Xiaoxin Sheng

Hi, @Anonymous,

 

Here are the links of sample data. Thank you in advance!

 

Sales Table

 

Shipment Table

Anonymous
Not applicable

Hi @mussaenda ,

 

You can refer to following steps to create a matrix to achieve your requirement.

 

Steps:

1. Create a calculate table with combined order no as bridge.

 

Bridge =
DISTINCT (
    UNION ( VALUES ( Sales[Document No_] ), VALUES ( Shipment[Order No_] ) )
)

 

 

2. Build relationships from sale to bridge,  shipment to bridge based on order no.

 

3. Use above table fields to create matrix visual.

10.png


Regards,

Xiaoxin Sheng

 

Hi, @Anonymous

 

Thank you for sharing your solution. Upon doing it, I noticed that you did not put the Qty ordered(from the Sales table) in the matrix. The main purpose of doing this is to deduct the Qty Base (Shipment Table) from Qty Base (Sales Table) to get the Outstanding/Open Qty with the dates involved.

 

Thank you,

Mussaenda

Anonymous
Not applicable

Hi @mussaenda ,


You can add another 'qty base' to value fields, rename these fields based their table name.(sale qty, shipment qty)

After these steps, you can add a measure to get diff from two qty and group by current category.

 

It will display remain qty which you wanted.

 

Regards,

Xiaoxin Sheng

Hi @Anonymous,

 

Thank you for suggesting. I tried to add the order qty in the matrix but it is duplicating base on the rows of date. If you will enlighten me on grouping by current category, it will be a big help since I am a newbie. Bear with me.

 

See photo below, Thank you!

Untitled.png

 

 

 

Warm Regards,

Mussaenda

Anonymous
Not applicable

Hi @mussaenda,

 

You can drag this column row fields after order date, then it will display as total amount of shipment qty.(I rename two fields as sole qty and shipment qty)

20.png

 

Regards,

Xiaoxin Sheng

Hi @Anonymous,

 

Maybe my questions were not clear. Sorry for that. I will post a clearer question. Thank you for answering my question here, you are brilliant.

 

 

Mussaenda

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors