Forum Discussion
Getting Datediff between date time , Getting Average and Getting of KPI ( Miss and Hit )
- 2 years ago
Hi syaiful_fcpc ,
Based on the sample and description you provided, Please try the following steps:
Target1. Create a column (CCWH) to get Datediff.
CCWH = DATEDIFF('Table'[X.CCFINISHDATE],'Table'[X.ACTDELIVTRUCKING],HOUR)Target 2. Create a column (ATACC) to get Datediff.
ATACC = DATEDIFF('Table'[X.ATACCSTARTDATE],'Table'[X.CCFINISHDATE],HOUR)Target 3. Getting Average Hour point 1.
Avg_CCWH = AVERAGE('Table'[CCWH])Target 4. Getting Average Hour point 2.
Avg_ATACC = AVERAGE('Table'[ATACC])Target 5.
Measure1 = IF(SELECTEDVALUE('Table'[Avg_CCWH]) < MAX('Table'[ATACC]), "Hit", "Miss")Target 6.
Measure2 = IF(SELECTEDVALUE('Table'[Avg_ATACC]) < MAX('Table'[ATACC]), "Hit", "Miss")Target 7.
Avg_Total = 'Table'[Avg_CCWH] + 'Table'[Avg_ATACC]Result is as below.
For further details,please find attachment.
From your description, I noticed that your Target8 and the previous Target has some similarities.
Please correct me if I misunderstood your needs.Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 2 years ago
Thanks for solution
Hi syaiful_fcpc ,
Based on the sample and description you provided, Please try the following steps:
Target1. Create a column (CCWH) to get Datediff.
CCWH = DATEDIFF('Table'[X.CCFINISHDATE],'Table'[X.ACTDELIVTRUCKING],HOUR)
Target 2. Create a column (ATACC) to get Datediff.
ATACC = DATEDIFF('Table'[X.ATACCSTARTDATE],'Table'[X.CCFINISHDATE],HOUR)
Target 3. Getting Average Hour point 1.
Avg_CCWH = AVERAGE('Table'[CCWH])
Target 4. Getting Average Hour point 2.
Avg_ATACC = AVERAGE('Table'[ATACC])
Target 5.
Measure1 = IF(SELECTEDVALUE('Table'[Avg_CCWH]) < MAX('Table'[ATACC]),
"Hit",
"Miss")
Target 6.
Measure2 = IF(SELECTEDVALUE('Table'[Avg_ATACC]) < MAX('Table'[ATACC]),
"Hit",
"Miss")
Target 7.
Avg_Total = 'Table'[Avg_CCWH] + 'Table'[Avg_ATACC]
Result is as below.
For further details,please find attachment.
From your description, I noticed that your Target8 and the previous Target has some similarities.
Please correct me if I misunderstood your needs.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for solution