Forum Discussion

yvitancio's avatar
yvitancio
Frequent Visitor
2 years ago
Solved

Totalizar valores de una medida calculada

Buenas tardes

Tengo una tabla TAMBIENTES de la siguiente forma

IDEDIFICACIONNROPISOIDAMBIENTE
00110011001
00110011002
00110011003
00120012001
00120012002
00120012003
00130013001
00130013002
00130013003
00130013004
00210021001
00210021002
00220022001
00220022002
00230023001
00230023002

 

la cual tiene una tabla detalle llamada TAMBIENTESCALIFICACION,

IDAMBIENTECRITERIOCALIFICACION
001100111
001100120.5
001100130

he creado una medida que calcula la calificacion para cada registro de la tabla TAMBIENTES, con la siguiente formula 

"mTieneBrecha = IF(AVERAGE(TAMBIENTESCALIFICACION[CALIFICACION])>=0.67,1,0)"
 
El resultado por fila de TAMBIENTES me sale bien, pero requiero el conteo total de los ambientes que tienen brecha 
 
IDAMBIENTEmTieneBrecha
00110010
00110021
00110031
00120011
00120020
00120030
total brecha 

 

Necesito una formula que permita obtener el total por piso y el total por edificacion edificacion, agradecezco de antemano su gentil apoyo

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from lbendlin , please allow me to provide another insight:

    Hi, yvitancio and Yvs 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2.Second, you can use custom columns to group the top half of the field output by:

    Text.Start([IDAMBIENTE],4)

    3.Then, using the matrix, modify the settings for the visualization:

    4.Next, modify your measure to a calculated column:

    5.Here are the end results:

     

    If I misunderstand your needs, I hope you can point out where I understand wrong, and preferably have an expected output.

     

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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

     

3 Replies

  • Something seems to be off with your IDAMBIENTE field. Shouldn't that be two separate columns? One for building and one for floor?  

    • Yvs's avatar
      Yvs
      New Member

      En la dimension TAMBIENTES el piso y la edificacion estan separados como se presenta en la primera tabla, la última tabla representa el gráfico usado en el powerbi para visualizar el resultado

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks for the reply from lbendlin , please allow me to provide another insight:

        Hi, yvitancio and Yvs 

        Regarding the issue you raised, my solution is as follows:

        1.First I have created the following table and the column names and data are the data you have given:

        2.Second, you can use custom columns to group the top half of the field output by:

        Text.Start([IDAMBIENTE],4)

        3.Then, using the matrix, modify the settings for the visualization:

        4.Next, modify your measure to a calculated column:

        5.Here are the end results:

         

        If I misunderstand your needs, I hope you can point out where I understand wrong, and preferably have an expected output.

         

        Please find the attached pbix relevant to the case.

         

        Best Regards,

        Leroy Lu

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