Forum Discussion

Victor1986's avatar
Victor1986
Helper I
3 years ago

calculo complexo

Bom dia!

Preciso calcular o resultado de saida de MUNICIPIO....

A regra é pegar a utltima DATA_UPDATE, maior ERB_FALHA por UF e retornar o municipio que teve maior registro de ERB_FALHA.

Segue link com os dados compartilhados  https://easyupload.io/k4h5gi

 

 

 

5 Replies

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Victor1986 

     

    Sorry I can't access your link. Can you represent the sample data in Excel, and the output you expect. The image of your original post cannot be enlarged, and the details cannot be seen clearly.

     

    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.

      • elder_lops's avatar
        elder_lops
        Frequent Visitor

        Olá! Victor

         

        Fiz algumas medidas e cheguei a um resultado que seja o que procura.

         

        Criei uma tabela exemplo no powerquery para conseguir fazer os calculos abaixo o layout do arquivo modelo.

         

        Para chegar ao resultado eu utilizei duas medidas.

         

         

  • elder_lops's avatar
    elder_lops
    Frequent Visitor

    Bom dia! Vitor

    Ok, mas no caso poderá haver cidades empatadas, quando houver essa situação o sistema deverá escolher uma ou apresentar as duas na lista.