Forum Discussion

MSW's avatar
MSW
Helper I
4 years ago
Solved

Sequential Calculation Between Date

Hello PBI Community,    I'm stuck on trying to figure out how to make a dax calculation for the following data. I need a calculation that will count sequentially by ID the days between two dates us...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, MSW ,

    Try it.

    Measure = var _a=CALCULATE(MAX('Table'[Complete Date]),FILTER(ALL('Table'),[ID]=MAX([ID])&& [EQ]<MAX('Table'[EQ])))
    return 
    IF(MAX('Table'[EQ])=10,DATEDIFF(MAX('Table'[StartDate]),MAX('Table'[Complete Date]),DAY),DATEDIFF(_a,MAX('Table'[Complete Date]),DAY))

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.