cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Calculate percentage for 2 date columns

Hi,

I am trying to create a measure to see if the job performed is ON Time or Delayed in percentage.

Where Scheduled Job date and Actual job date are 2 columns.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Calculate percentage for 2 date columns

You can create a measure using DAX below:

```Is Delay =
VAR Delay_Time = DATEDIFF(MAX('Table'[Scheduled  date]), MAX('Table'[Actual Date]), MINUTE)
RETURN
IF(Delay_Time > 10, "Yes", "No")```

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Established Member

## Re: Calculate percentage for 2 date columns

You could try something like:

 Job Schedule Date Actual Date 1 1/1/2019 1/1/2019 2 1/1/2019 1/1/2019 3 1/1/2019 1/1/2019 4 1/1/2019 1/2/2019 5 1/2/2019 1/2/2019 6 1/2/2019 1/2/2019 7 1/2/2019 1/3/2019 8 1/3/2019 1/3/2019 9 1/3/2019 1/3/2019 10 1/3/2019 1/4/2019

On Time = DIVIDE(CALCULATE(COUNT(Table1[Job]),FILTER(Table1,Table1[Actual Date]=Table1[Schedule Date])),COUNT(Table1[Job]))
Community Support Team

## Re: Calculate percentage for 2 date columns

Could you please share some sample data and post the expected result?

Regards,

Jimmy Tao

Frequent Visitor

## Re: Calculate percentage for 2 date columns

This is the sample data,

It is to calculate difference between scheduled and actual date / total number of loads per carrier in percent. where the allowed delay is 10mins.

 load_number Customer_number Carrier_number Scheduled  date Actual Date 10011 ABC PU99 1/20/2015 18:00 1/20/2015 0:01 10015 ABC FZMT 1/20/2015 11:00 1/21/2015 0:01 10020 ABC PU99 1/20/2015 10:00 1/20/2015 0:01 10021 ABC PU99 1/21/2015 8:00 1/20/2015 0:01
Community Support Team

## Re: Calculate percentage for 2 date columns

You can create a measure using DAX below:

```Is Delay =
VAR Delay_Time = DATEDIFF(MAX('Table'[Scheduled  date]), MAX('Table'[Actual Date]), MINUTE)
RETURN
IF(Delay_Time > 10, "Yes", "No")```

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.