Forum Discussion

GeorgW's avatar
GeorgW
Helper II
4 years ago
Solved

Final Status Code

Hello, I have a table (phone call log) with many entries (each forwarding of the phone call creates a new row). To determine the final status (did the caller reach someone or not), I have an "ID" fo...
  • v-xiaotang's avatar
    v-xiaotang
    4 years ago

    Hi GeorgW 

    try this

    Measure = 
    var _table=ALLEXCEPT('Table','Table'[ID])
    var _maxtime=CALCULATE(MAX('Table'[time]),_table)
    var _code=200
    var _mincode=CALCULATE(MIN('Table'[StausCode]),FILTER(_table,'Table'[time]=_maxtime))
    return
    SWITCH(TRUE(),
    MIN('Table'[time])=_maxtime&&MIN('Table'[StausCode])=_code,_code,
    MIN('Table'[time])=_maxtime&&MIN('Table'[StausCode])=_mincode,100)

    result

     

    Best Regards,

    Community Support Team _Tang

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