Forum Discussion

prabhupan's avatar
prabhupan
Icon for Helper I rankHelper I
9 years ago
Solved

DateDiff by Date and Status

hello,    I have see an earlier post on the same requirement.   https://community.powerbi.com/t5/Desktop/DateDiff-by-Date-and-Status/m-p/81760   However the formula given there is giving the fo...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    9 years ago

    Hi prabhupan,

    Please create a measure using the following formula.

    measure = VAR max-statu Date = CALCULATE(MAX([StatusDate]),ALLEXCEPT(Table, Table[requestID]))
    VAR min-start Date = CALCULATE(MIN([StartDate]),FILTER(Table,ALLEXCEPT(Table, Table[requestID]))
    RETURN DATEDIFF(Table[max-statu Date], Table[min-start Date ],DAY)


    Best Regards,
    Angelia