Forum Discussion

Bcomm_student's avatar
Bcomm_student
Regular Visitor
5 months ago
Solved

Need all my difference between dates to be positive

I'm doing a university assignment and part of the instructions is to show the time between an order and shipment date. Both dates came with hierarchies so I've made the column  Delivery days = Data...
  • cengizhanarslan's avatar
    5 months ago

    Use the full date columns and the DATEDIFF() function:

    Delivery days =
    DATEDIFF ( Data[Order Date], Data[Delivery Date], DAY )

     

    If your assignment requires only positive values:

    Delivery days =
    ABS( DATEDIFF ( Data[Order Date], Data[Delivery Date], DAY ) )