Forum Discussion

rmcclung's avatar
rmcclung
Frequent Visitor
3 years ago
Solved

Please help - Calculate difference in dates categorized by a job schedule number

Hey Everyone,   I'm struggling on this one. My data is pulling in from an Excel sheet (attached) and I need to perform a calculation that pulls the difference (in days) between column C [Date Start...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi rmcclung 

    You can refer to the following calculated column.

    Result =
    VAR a =
        CALCULATE (
            MIN ( 'Table'[Date Started] ),
            FILTER (
                'Table',
                'Table'[ob Schedule (Stamped)] = EARLIER ( 'Table'[ob Schedule (Stamped)] )
            )
        )
    RETURN
        IF (
            'Table'[Date Started] = a,
            IF (
                DATEDIFF ( 'Table'[Date Started], 'Table'[Date Completed], DAY ) < 30,
                DATEDIFF ( 'Table'[Date Started], 'Table'[Date Completed], DAY ),
                BLANK ()
            )
        )
    

    Output

     

    Best Regards!

    Yolo Zhu

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