Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
5 years ago
Solved

Select latest value

Hello, good afternoon
I'm trying to kpi on incidents and have trouble performing a measure that selects the most recent value for me.

From a table, with the same sequence and action and different procedure and date action IDs, you would need it to be considered the most recent.

Davidbravo_0-1611776482328.png

That is, I need to count the last line that contains "Accept Pre-Traffic" that corresponds to the value "N2 Postage".

Can you think of how to perform this action?

This measure that I calculate will be used to get the KPI in a later step.

Thank you very much in advance.

  • Anonymous's avatar
    Anonymous
    5 years ago

    Don'@Syndicate_Admin,

    According to your description, are the results highlighted below what you want?

    v-yuaj-msft_0-1612148159507.png

    You can create some measures as follows.

    KPI_A de la casa de los 100o (

    var x1-FILTER(ALL(A),[ACTION ]-"Aceptar transferencia")

    var x2-CALCULATE(MAX([FECHA_ACCION ]),x1,ALL())

    devolución

    CALCULATE(MAX(A[GRUPO_EJECUTOR]),FILTER(x1,[FECHA_ACCION ]-x2))




    KPI_B ?

    var x1-FILTER(ALL(B),[ACTION ]-"Aceptar transferencia")

    var x2-CALCULATE(MAX([FECHA_ACCION ]),x1,ALL())

    devolución

    CALCULATE(MAX(B[GRUPO_EJECUTOR]),FILTER(x1,[FECHA_ACCION ]-x2))

    Result:

    v-yuaj-msft_1-1612148159509.png

    I hope that's what you were looking for.

    Best regards

    Yuna

    If this post helps,then consider Accepting it as the solution to help other members find it faster.

3 Replies

  • Syndicate_Admin , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

    Try a measure like

    countx(summarize(filter(Table, Table[status]= "N2 Postage" && search("Accept Pre-Traffic",Table[Acction],,0) >0 ), Table[Secuencia],"_1",max(Table[Fecha_accion)),[_1])

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Hello, good afternoon

      Thanks a lot! served me yesterday's lead.

      I tried to perform the summarize to create a measure that gets me the last GRUPO_EJECUTOR ordering by the largest number of ID-PROCEDURES and I have not been able.

      ejemplo.jpg

      I've tried to do the following, I get results but they're not well.

      pendient =
      VAR tablatemp =
      SUMMARIZE (
      T_Procediments_INCs,
      T_Procediments_INCs[SECUENCIA],
      T_Procediments_INCs[ID_PROCEDIMIENTO],
      T_Procediments_INCs[BUZON_ORIGEN],
      "@datos", 1
      )
      RETURN
      COUNTROWS (FILTER (tablatemp, max(T_Procediments_INCs[ID_PROCEDIMIENTO])))

      I stick the board here even though it looks a little disorganized.

      SEQUENCE ID_PROCEDIMIENTO FECHA_ACCION ACTION GRUPO_EJECUTOR
      INC-bbbbbbb 1 26/11/2020 14:01 Create Bulletin with TCS_INFRASDR
      INC-bbbbbbb 3 26/11/2020 14:07 Accept Delegate TCS_INFRASDR
      INC-bbbbbbb 4 26/11/2020 14:17 Accept Transfer CC_GER_N1
      INC-bbbbbbb 5 26/11/2020 16:08 Accept Pre-CC_GER_N2_T
      INC-bbbbbbb 6 28/11/2020 1:47 Accept TCS_INFRASDR
      INC-bbbbbbb 7 30/11/2020 7:29 Franquear CC_GER_N2_T


      The result of the measure should be CC_GER_N1

      SEQUENCE ID_PROCEDIMIENTO FECHA_ACCION ACTION GRUPO_EJECUTOR
      INC-aaaaaa 2 11/05/2020 16:05 Create Bulletin with OMEGA Data
      INC-aaaaaa 3 11/05/2020 16:09 Mark CC_GER_N1
      INC-aaaaaa 4 11/05/2020 16:11 Uncheck CC_GER_N1
      INC-aaaaaa 5 12/05/2020 7:08 Accept Transfer CC_GER_N1

      The result of the measure should be in this second case CC_GER_N1.

      With the measure I already compare it with the status and if it is different from "Franquear" I would already have the data that I need to calculate the outstanding incidents.

      e.g. won't let me upload table in html or excel attachment.

      Thank you very much for the help

      Best regards

      David

  • Anonymous's avatar
    Anonymous
    Not applicable

    Don'@Syndicate_Admin,

    According to your description, are the results highlighted below what you want?

    v-yuaj-msft_0-1612148159507.png

    You can create some measures as follows.

    KPI_A de la casa de los 100o (

    var x1-FILTER(ALL(A),[ACTION ]-"Aceptar transferencia")

    var x2-CALCULATE(MAX([FECHA_ACCION ]),x1,ALL())

    devolución

    CALCULATE(MAX(A[GRUPO_EJECUTOR]),FILTER(x1,[FECHA_ACCION ]-x2))




    KPI_B ?

    var x1-FILTER(ALL(B),[ACTION ]-"Aceptar transferencia")

    var x2-CALCULATE(MAX([FECHA_ACCION ]),x1,ALL())

    devolución

    CALCULATE(MAX(B[GRUPO_EJECUTOR]),FILTER(x1,[FECHA_ACCION ]-x2))

    Result:

    v-yuaj-msft_1-1612148159509.png

    I hope that's what you were looking for.

    Best regards

    Yuna

    If this post helps,then consider Accepting it as the solution to help other members find it faster.