Forum Discussion

Bcomm_student's avatar
Bcomm_student
Regular Visitor
6 months ago
Solved

Calculating Days late with specific target times

Part of an assignment for university is making a table for some data showing delivery days and days late, and we only need to show values for the ones that were actually late. I have this table:  ...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    6 months ago

    Hi,

    Write this calculated column formula in the Regions table

    Target = 1*(LEFT(Regions[Target Days],SEARCH(" ",Regions[Target Days])-1))

    Write these calculated columns in the Data table

    Diff = 1*('Data'[Delivery Date]-'Data'[Order Date])
    Target = CALCULATE(MAX(Regions[Target]),FILTER('Regions','Data'[Customer Province]='Regions'[Location]))
    Column 2 = if(Data[Diff]<Data[Target],"early",if(Data[Diff]=Data[Target],"on time","late"))

    Hope this helps.