Forum Discussion

Marcin's avatar
Marcin
Icon for Helper V rankHelper V
8 years ago
Solved

DatediffbyRows

Hi,   I am looking for solution to calculate DAYs difference between Process1 date and Process3 date for each project in calculated column.                  Project                               ...
  • v-jiascu-msft's avatar
    8 years ago

    Hi Marcin,

     

    Try this measure please.

    Measure =
    VAR p1Date =
        CALCULATE (
            MIN ( 'Table1'[Date] ),
            FILTER (
                ALLEXCEPT ( Table1, 'Table1'[ProjectID] ),
                'Table1'[ProcessName] = "Process1"
            )
        )
    VAR p3Date =
        CALCULATE (
            MIN ( 'Table1'[Date] ),
            FILTER (
                ALLEXCEPT ( 'Table1', Table1[ProjectID] ),
                'Table1'[ProcessName] = "Process3"
            )
        )
    RETURN
        DATEDIFF ( p1Date, p3Date, DAY )
    

    Datediffby_Rows

     

    Best Regards,

    Dale