Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Adding date column to a table by referencing another table's date column

Hello,

 

I am trying to add an Actual Ship Date column to the Order Detail table as this table doesn't currently have a date reference. The Order Master table currently contains an Actual Ship Date column and these tables have a one-to-many relationship on the Order ID field.

 

Pbix file link is below.

 

https://1drv.ms/u/s!AiFttrDOn_FqgRO-tDqIzwCnJuZ_?e=bp6Jyv

  • Anonymous ,

     

    So relationship between 'Order Master' and 'Order' is one-many, right? You can click query editor-> merge tables. Then remove the useless columns except [Actual Ship Date] column.

     

    Regards,

    Jimmy Tao

  • Anonymous's avatar
    Anonymous
    7 years ago

    I was able to figure out what I needed.  I added a column to the Order Detail table with the following formula.

     

    Actual Ship Date = CALCULATE(MAX('Order Master'[Actual Ship Date]))

3 Replies

  • v-yuta-msft's avatar
    v-yuta-msft
    Icon for Community Support rankCommunity Support

    Anonymous ,

     

    So relationship between 'Order Master' and 'Order' is one-many, right? You can click query editor-> merge tables. Then remove the useless columns except [Actual Ship Date] column.

     

    Regards,

    Jimmy Tao

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-yuta-msft ,

       

      Thank you for the response. I can do this, but I was wondering if there is a way to create a column (in memory) in the Order Detail table so I wouldn't have to create another, large table.

       

      This should work though so I appreciate the solution.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I was able to figure out what I needed.  I added a column to the Order Detail table with the following formula.

     

    Actual Ship Date = CALCULATE(MAX('Order Master'[Actual Ship Date]))