Forum Discussion

Orstenpowers's avatar
Orstenpowers
Post Patron
6 years ago
Solved

Measure On time delivery performance

Dear all,

I do have a problem with my below table. I would need to generate two information:

1. Is it an "on-time" delivery, meaning "Delivery date" </= "Requested Delivery Date"? If this is true, "YES" should appear, otherwise "NO".

2. What is the difference (in days) between the "Requested Delivery date" and the "Delivery Date".


First question I have is, would you solve this in Query-Editor or at the Desktop?

Actually I think the first one should/ could be an additional column in the Query Editor, while the second one should be at the Desktop by using a specific formula...but which one? ğŸ¤”

 

I hope you can help me as I am stuck...

  • Hi,

     

    According to your description, i think these two requirements can be easily reached by DAX.

    Here is my test table:

    For your issue 1, please try this calculated column:

    Column = IF('Table'[Delivery Date]<='Table'[Requested Delivery Date],"Yes","No")

    For your issue 2, please try this calculated column:

    Column 2 = DATEDIFF('Table'[Delivery Date],'Table'[Requested Delivery Date],DAY)

    The result shows:

    Hope this helps.

     

    Best Ragards,

    Giotto Zhi

3 Replies

  • Hi,

    The first problem I just could solve on my own by using following conditional column: ğŸ˜€

     

    = Table.AddColumn(#"Replaced Errors", "Benutzerdefiniert", each if [Planned Delivery Date Customer] = null then "On Time" else if [Planned Delivery Date Customer] >= [Delivery Date] then "On Time" else "Late")

  • Try like

    if(datediff([Requested Delivery date],[Delivery Date],Day) >0,"Yes","No")

  • v-gizhi-msft's avatar
    v-gizhi-msft
    Community Support

    Hi,

     

    According to your description, i think these two requirements can be easily reached by DAX.

    Here is my test table:

    For your issue 1, please try this calculated column:

    Column = IF('Table'[Delivery Date]<='Table'[Requested Delivery Date],"Yes","No")

    For your issue 2, please try this calculated column:

    Column 2 = DATEDIFF('Table'[Delivery Date],'Table'[Requested Delivery Date],DAY)

    The result shows:

    Hope this helps.

     

    Best Ragards,

    Giotto Zhi