Forum Discussion

Neiltc's avatar
Neiltc
Frequent Visitor
8 years ago
Solved

Data formatting with date

I am trying to create a graphic that shows data for projects where the projects and within time, almost due or overdue and then display this in a graph, pie chart etc but im struggling with the forma...
  • erik_tarnvik's avatar
    erik_tarnvik
    8 years ago

    OK assuming you have a table Proj like this:

    ProjectDueActual
    A8/1/20177/30/2017
    B8/1/20178/10/2017
    C8/1/20178/5/2017
    D8/1/20178/10/2017

     

     

    Add two calculated columns to Proj:

    Diff = IF(Proj[Due] > Proj[Actual],
              -DATEDIFF(Proj[Actual], Proj[Due], DAY),
              DATEDIFF(Proj[Due], Proj[Actual], DAY))
    
    Status = IF(Proj[Diff] > 6,
                "Overdue",
                IF(Proj[Diff] > 0,
                   "Delayed",
                   "On Time"))

    You can now easily display a simple table visual:

    by placing the columns of Proj like this and chnaging the data colors appropriately: