Forum Discussion

digitalpresto's avatar
digitalpresto
Frequent Visitor
5 years ago
Solved

Track reversed orders from timestamp data

Hi guys, I have the following data. Basically, for each order id, the system records timestamps for each of the status columns. The sample data below if only for ONE ORDER ID. The sequence of statuse...
  • v-kkf-msft's avatar
    5 years ago

    Hi digitalpresto ,

     

    Try the following formula:

     

    Measure = 
    var t = MAX('Table'[Status Appr Date])
    return 
        CALCULATE(
            DISTINCTCOUNT('Table'[ID]),
            FILTER(
                'Table',
                'Table'[Status Appr Date] <> BLANK()
                && (
                    'Table'[Status New Date] > t 
                    || 'Table'[Status Wvalid Date] > t 
                    || 'Table'[Status Valid Date] > t
                    || 'Table'[Status Wappr Date] > t
                )
            )
        )
    Measure 2 = 
    IF(
        ISFILTERED('Table'[ID]),
        [Measure],
        SUMX(
            ALLSELECTED('Table'[ID]),
            [Measure]
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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