Forum Discussion

Klein_Hartje's avatar
Klein_Hartje
Frequent Visitor
4 years ago
Solved

How to compare two date columns in the same table using the operator Greater

Please I want to calculate this metric and it returns TRUE or FALSE:
 
Late Deliveries Flag = [Order Delivered Date to Customer] > [Order Estimated Delivery Date]
 
 
 
  • Hi:

    If you do it as calculated columnin the same table where this info is:

    Flag = IF(TableName[Order Delivered Date to Customer] < TableName[Order Estimated Delivery Date] ,"TRUE", "False")
    as a measure:
    Flag T/F =
    var orderdelivered = SELECTEDVALUE(TableName[Order Delivered Date to Customer)
    var estdeldate = SELECTEDVALUE(TableName[Order Estimated Delivery Date])
    return
    IF(orderdelivered > estdeldate,"TRUE", "False")
     
    I hope this works for you. Thanks..

1 Reply

  • Hi:

    If you do it as calculated columnin the same table where this info is:

    Flag = IF(TableName[Order Delivered Date to Customer] < TableName[Order Estimated Delivery Date] ,"TRUE", "False")
    as a measure:
    Flag T/F =
    var orderdelivered = SELECTEDVALUE(TableName[Order Delivered Date to Customer)
    var estdeldate = SELECTEDVALUE(TableName[Order Estimated Delivery Date])
    return
    IF(orderdelivered > estdeldate,"TRUE", "False")
     
    I hope this works for you. Thanks..