Forum Discussion

Tesy's avatar
Tesy
Icon for Helper I rankHelper I
1 year ago
Solved

Función MID

Hola comunidad,

 

Estoy tratando de crear esta formula que tengo en excel al Power BI

=VALUE ( MID ( W2 , SEARCH ( "Horas de participación" , W2 ) + 26 , SEARCH ( ";Evaluación global", W2 ) - SEARCH ("Horas de participación" , W2 ) - 26 ) )

 

Pero no lo estoy logrando, me pueden ayudar en corregirla?

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, Tesy 

     

    You can try the following methods.

    Horas = 
    VAR HorasPos = IFERROR(SEARCH("Horas de participación", 'Table'[COLUMNNAME]), 0)
    VAR EvalPos = IFERROR(SEARCH(";Evaluación global", 'Table'[COLUMNNAME]), 0)
    VAR IsPatternFound = (HorasPos > 0) && (EvalPos > HorasPos + 26)
    VAR ExtractedText = 
        IF(
            IsPatternFound,
            MID('Table'[COLUMNNAME], HorasPos + 26, EvalPos - (HorasPos + 26)),
            BLANK()
        )
    RETURN
        IF(IsPatternFound, VALUE(ExtractedText), BLANK())

    Is this the result you expected?

     

    Best Regards,

    Community Support Team _Charlotte

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

12 Replies

  • Tesy 

    you can try to create a column 

     =MID ( [COLUMNNAME], SEARCH ( "Horas de participación" , [COLUMNNAME]) + 26 , SEARCH ( ";Evaluación global", [COLUMNNAME]) - SEARCH ("Horas de participación" , [COLUMNNAME]) - 26 ) 

     

    if this does not work, pls provide the error message or provide some sample data and expected output

    • Tesy's avatar
      Tesy
      Icon for Helper I rankHelper I

      Muchas gracias, adjunto 2 lineas de ejemplo:

      ID del módulo: - XXXX | 5 | Finanzas aplicado a ventas;Elige el tipo de servicio: - U4O NACIONAL- ORGANIZACIONES;Programa: - Escuela de Ventas Destilería Orendain;Grado: - XXXXXXXX;Horas de participación: - 8;Evaluación global: - 9 (Factor 3.7);Fecha de inicio: - 06/11/24;Fecha de fin: - 27/11/24;Monto a pagar (SIN IVA): - XXXXX
      ID del módulo: - | XX | Coach 1: sesión individual (5 per;Nombre de Proyecto/Programa/Tema: - Desarrollo de XXXXXXXX XXXXX;Nivel: - XXXXXXXX (XXXXX);Número de horas: - 5;Fecha de inicio: - 25/11/24;Fecha de fin: - 29/11/24;Monto a pagar (SIN IVA) - XXXX
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi, Tesy 

         

        Can you present your data in a table?

         

        Best Regards

    • Tesy's avatar
      Tesy
      Icon for Helper I rankHelper I

      Hola,

       

      Funcionó algo las 2 lineas que te compartí?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi, Tesy 

         

        The formatting of those two lines above is not clear enough. Can you provide a screenshot of the source data in Excel?

         

        Best Regards,

        Community Support Team _Charlotte

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