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

Summarizing data to find redeployments/repeated stock transfers

Hi all, I am trying to find the quantity of stock that is redeployed (dispatched again to other DC) from a DC after being received.

 

The end requirement should look similar to this table. The material 11111 with BatchID ABC was first sent from 8881 to 7771 (Quanity 150). After being received at 7771, it was again sent to 4451 (Quantity 100) which isn't advised.

(In case this view is not possible, please propose another view that conveys similar information)

MaterialID   BatchID   Origin   Destination   Quantity   2_Origin   2_Destination   Dwell Time   Redeployed Quantity   
11111ABC888177711507771445122100

 

The data contains two transaction tables: 1. TransportDetails 2. MaterialDetails

 

TransportDetails_Joined table contains the list of transport orders with material, source, destination & date details.

First 7 columns from OrderID to Quantity give details about the primary transport order, colums 8 through 14 give details about the redeployment (the material is sent to another location after being received.) For e.g., looking at the first row we see that material 11111 is moved from 8881 to 7771, and then sent to 4451 from 7771.

 

(This is a wide table with 14 columns, please scroll horizontally)

TransportDetails_Joined            
OrderIDMaterialID   Origin   Destination   ShippingDate   ReceiptDate   Quantity   2_OrderID   2_MaterialID   2_Origin   2_Destination   2_ShippingDate   2_ReceiptDate   2_Quantity   
3123456111118881777109/26/202309/28/20231503812345111117771445110/20/202310/24/2023100
3123456111118881777109/26/202309/28/20231503900001111117771664110/29/202311/02/2023480

 

 

This TransportDetails table was created by me after doing a self join of the following original TransportDetails table with a few conditions like (left MaterialID = right MaterialID), (left destination = right source), (left ReceiptDate < right ShippingDate) .

 

OrderID   MaterialID   Origin   Destination   ShippingDate   ReceiptDate   Quantity   
3123456111118881777109/26/202309/28/2023150
3123456111118881777109/26/202309/28/2023150
3812345111117771445110/20/202310/24/2023100
3900001111117771664110/29/202311/02/2023480
3750001111112321542008/08/202308/10/2023250
3780002111123593675007/07/202307/10/2023125

 

 

MaterialDetails table provides information about the batch that was transferred in each OrderID. 

MaterialDetails    
OrderIDMaterialID   BatchID   Destination   PostingDate   Quantity
312345611111ABC777109/25/2023150
381234511111ABC445110/19/2023100
390000111111GGG664110/28/2023480

 

I want to create a measure/calcualted column or some other method to summarize data such that it indicates the actual quantity redeployed when the BatchIDs match. We need to achieve this using MaterilDetails table and TransportDetails_Joined or the original TransportDetails table. We can create any number of intermediate tables if required.

 

The final table should look something like this. Redeployed Quantity needs to be found for each material & batchID combination. Dwell time is the time period between the first transfer's receipt date and the second transfer's shipping date = (2_ShippingDate) - (ReceiptDate)

(In case this view is not possible, please propose another view that conveys similar information)

MaterialID   BatchID   Origin   Destination   Quantity   2_Origin   2_Destination   Dwell Time   Redeployed Quantity   
11111ABC888177711507771445122100

 

I've been trying so hard to summarize the data and can't find a neat approach. Please help me with creating this summary. Any help is greatly appreciated. Thanks in advance!

1 REPLY 1
NKumar
Frequent Visitor

This post was originally marked as spam and now it has been moved back. Commenting here so that it gets more views. 

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.