Order Time to Delivery Time ect

I have the dax for total order time, see “Total Delivery = CALCULATE(AVERAGE(‘Time Metrics’[Delivery Time]), FILTER(‘Time Metrics’, ‘Time Metrics’[Delivery Time] <= 600))”

I would like to create calculations for each column in fine. Anybody steer me in the right direction please?

Order Detail Template - for BI.xlsx (9.9 KB)

Hi @Yrstruly , we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

image

  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

@Yrstruly,
Problem is not clear. What do you mean by “create calculations for each column in fine” means?

From the scenario explained above, how would you solve the problem?

Hi @Yrstruly. The scenario is not clear. Please provide your work-in-progress PBIX file along with a screen shot of what you’re getting and an Excel mock-up (using the same data) showing exactly the outcome you’re looking for.
Greg

1 Like

Hi @Yrstruly , we’ve noticed that no response has been received from you since the 11th of March.

We are waiting for the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

See pbx file below.

I have the following code that i need to alter to add additional time metrics such as:

Document Number, Status,
Time Elapsed Minutes, Created Date, Created Time, Accepted By Store,
Minutes To Accepted By Store, Invoiced At, Mins Elapsed, Invoiced,
Driver Accepted, Mins Driver Accepted, Driver At Store Mins Driving To Store,
,Mins Driver In Store, Driver Starts Delivery,
,Driver Arrival At Client,Mins Driving To Client,
Driver Completes Delivery,
Total Mins Elapsed To Delivery.

Please assist?

SELECT DATE(o.created_datetime) as Date, o.store_uid as ‘Store UID’
, o.uid as ‘Order’
, o.rating as ‘Rating’
, IF(o.accepted_datetime < o.driver_ready_datetime, TRUE, FALSE) as ‘Switch’
, timestampdiff(minute, o.created_datetime, o.accepted_datetime) as ‘Accepted Order’
, if(accepted_datetime < driver_ready_datetime, timestampdiff(minute, o.accepted_datetime, o.driver_ready_datetime), timestampdiff(minute, o.created_datetime, o.driver_ready_datetime)) as’Invoiced Order’
, timestampdiff(minute, o.created_datetime, o.delivered_datetime) as ‘Delivery Time’
, ROUND(if(o.amended_items_total IS NOT NULL, o.amended_items_total, o.items_total)

  • if(o.amended_bottles_fee IS NOT NULL, o.amended_bottles_fee, o.bottles_fee)
  • if(o.amended_delivery_fee IS NOT NULL, o.amended_delivery_fee, o.delivery_fee),2) as ‘Turnover’
    FROM order o
    WHERE o.status = ‘D’ AND NOT store_uid IN (6,56, 202)
    AND date(o.created_datetime) >= ‘2020-11-01’ Order Detail Template - for BI.xlsx (9.9 KB)

Time Metrics Report (4).pbix (5.1 MB)