Forum Discussion

Vemul's avatar
Vemul
Helper I
3 years ago

Order Status calculation based on Difference between Planned Date and Issued Date

Hi All,

hope I will get some help.
what I am looking is based on below table data looking to populate "Status"

1. if issue date < Planned Date then Status = " On Time"
2. if issue date > Planned Date then Status = " Late"
3. If Issue date = # and Planned Date < Today then Status = "Late"
4. If Issue date = # and Planned Date > Today then Status = "Waiting"

 

I wrote below code but having difficulties get 3 & 4 conditional results.

 
If(maxx(Table_ORD,Table_ORD[Planned Date] )> Maxx(Table_ORD,Table_ORD[Issue Date]),"On Time","Late")

Thanks - Vemu

Requested Date Planned DateIssue DateStatus 
22/02/202320/02/202320/02/2023On Time 
21/02/202318/02/202317/02/2023On Time 
22/02/202320/02/202321/02/2023Late
22/02/202320/02/2023#Late
24/02/202326/02/2023#Wainitng 

1 Reply

  • MAwwad's avatar
    MAwwad
    Solution Sage

     

    Hello! Based on the conditions you have provided, you can modify your DAX formula to the following:

     

     
    IF(ISBLANK(Table_ORD[Issue Date]), IF(Table_ORD[Planned Date] < TODAY(), "Late", "Waiting"), IF(Table_ORD[Issue Date] < Table_ORD[Planned Date], "On Time", "Late") )