Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Dax help : advanced date allocation between tables

Hi,

 

I would like to generate "Fulfill date" in table 1. Table 1 is the sales order by its site, sales order, line and SKUs.

It lists down the date that customers would like to deliver. So in table 1, the earliest date for each order line will be my priority to fulfill orders.  And table 2 is the estimation "shipped date" of  each batch of shipment. The scenario is that I would like to base on the priority of customer order (table 1) to map the "Ship date" (table 2) from the earliest to the latest in "Fulfill date."

 

Help needed for Power BI experts. Thanks.

 

 

Table 1:

CustomerSiteSales OrderLineSKUDateqtyAggregated_QtyFulfill dateRemarks
AUSA123D1JJ2022-06-10200022502022-07-10Priority 1 order : first date of Ship Date
BUSB125D3JJ2022-06-2120022502022-07-21Priority 2 order : second date of Ship Date
BUSB125D3JJ2022-07-215022502022-08-21Priority 3 order : third date of Ship Date

 

 

Table 2:

BatchSiteSKUShip DateQty
1USJJ2022-07-102000
2USJJ2022-07-21200
3USJJ2022-08-2150
  • table 1 

    add colnum

    Batch = rankx(filter(table 1,Site=eariler(Site) && SKU = eariler(SKU), Date,Date,asc)

     

    add colnum

    index = Batch & SKU & Site

     

    table 2 

     

    add colnum

    index = Batch & SKU & Site

     

    link 2 index colnum

3 Replies

  • vapid128's avatar
    vapid128
    Icon for Solution Specialist rankSolution Specialist

    table 1 

    add colnum

    Batch = rankx(filter(table 1,Site=eariler(Site) && SKU = eariler(SKU), Date,Date,asc)

     

    add colnum

    index = Batch & SKU & Site

     

    table 2 

     

    add colnum

    index = Batch & SKU & Site

     

    link 2 index colnum

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    sorry but I did not understand what are the expected results