Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Orstenpowers
Post Patron
Post Patron

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? 🤔

Screenshot_002.JPG

 

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

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

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

Here is my test table:

30.PNG

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:

31.PNG

Hope this helps.

 

Best Ragards,

Giotto Zhi

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

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

Here is my test table:

30.PNG

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:

31.PNG

Hope this helps.

 

Best Ragards,

Giotto Zhi

amitchandak
Super User
Super User

Try like

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

Orstenpowers
Post Patron
Post Patron

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")

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.