Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Porcentaje total de medida

Hola


contexto:

Tengo una fuente de datos que tiene múltiples preguntas y puntuaciones. Cada pregunta se agrupa en un "sub tema" y una "categoría". He creado una tabla de matriz y he mostrado el subtema.

output.PNG

En esta tabla, he creado la medida siguiente para sumar la puntuación en el origen de datos.

Puntuación total por sub tema =

SUM ( REF_DIM_DB_Benefits_Unpivot[Puntuación] )

He creado otra medida que cuenta el número de categorías asociadas a cada tema.

Recuento de categorías de sub-tema = CALCULATE(
DISTINCTCOUNT(REF_DIM_DB_Benefits_Unpivot[Mapping_table. Categoría]),
ALLEXCEPT(REF_DIM_DB_Benefits_Unpivot,REF_DIM_DB_Benefits_Unpivot[Mapping_table. Sub tema])
)

A continuación, he creado una medida final que divide la puntuación total por el número de categorías:

REF Puntuación total por sub tema / recuento de categorías =
ROUNDUP(SUMX(VALUES(REF_DIM_DB_Benefits_Unpivot[Mapping_table. Categoría]),
[Puntuación total por categoría / recuento de preguntas]) /[Recuento de categoría de tema sub],0)

problema:

Quiero crear otra columna que muestre el porcentaje del gran total de esta medida y permitir que la tabla se filtre por una segmentación de datos (título del proyecto). He pasado un par de horas pasando por los foros, pero desafortunadamente todavía no estoy equipado con el conocimiento para identificar una solución de trabajo.

Cualquier apoyo sería apreciado.

Saludos

AmiKhan

Cómo es el origen de datos:

data source example.PNG




1 ACCEPTED SOLUTION

@imranamikhan usted debe ser capaz de hacer esto utilizando el incorporado en % de la opción GT:

AllisonKennedy_0-1618308144373.png

De lo contrario, haz algo como:

% GT Medida = DIVIDE( [Medida], CALCULAR ( [Medida] , ALLSELECTED(tabla[categoría]) ) )

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

@imranamikhan puede añadir una columna de los resultados deseados?

Creo que puede encontrar AVERAGEX útil aquí?

AverageValue = AVERAGEX ( VALUES (REF_DIM_DB_Benefits_Unpivot[Mapping_table. Categoría]), REF_DIM_DB_Benefits_Unpivot[Puntuación] )

A continuación, puede utilizar la flecha hacia abajo en los valores para obtener % de valores GT, o utilizar la función ALLSELECTED para calcular esto también.

Gracias Allison, pero necesito % de grandes valores totales de las salidas de medida de"Puntuación total por sub tema / recuento de categorías". Ejemplo en Excel a continuación:

expected result.PNG

@imranamikhan usted debe ser capaz de hacer esto utilizando el incorporado en % de la opción GT:

AllisonKennedy_0-1618308144373.png

De lo contrario, haz algo como:

% GT Medida = DIVIDE( [Medida], CALCULAR ( [Medida] , ALLSELECTED(tabla[categoría]) ) )

Gracias Allison.

He vuelto a leer la publicación de Greg sobre este tema y me di cuenta de que no estaba siguiendo su consejo correctamente.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/td-p/547907

Medidas de trabajo definitivas

01. Sub Theme Count = CALCULATE(
   DISTINCTCOUNT(REF_DIM_DB_Benefits_Unpivot[Mapping_table.Category]),
   ALLEXCEPT(REF_DIM_DB_Benefits_Unpivot,REF_DIM_DB_Benefits_Unpivot[Mapping_table.Sub Theme])
   )
    //count number of themes

02. Divide score by Sub Theme Count = DIVIDE(
    SUM('REF_DIM_DB_Benefits_Unpivot'[Score]),
    [01. Sub Theme Count])

03. Divide score by Category count = 
ROUNDUP(SUM ( REF_DIM_DB_Benefits_Unpivot[Score] ) / COUNT( ( REF_DIM_DB_Benefits_Unpivot[Mapping_table.Category] )),0)
//divide by score by a count of categories

04. Measure_Total = 
VAR __table = SUMMARIZE(REF_DIM_DB_Benefits_Unpivot,[Mapping_table.Sub Theme],"__value",[03. Divide score by Category count])
RETURN
IF(HASONEVALUE(REF_DIM_DB_Benefits_Unpivot[Mapping_table.Sub Theme]),[03. Divide score by Category count],SUMX(__table,[__value]))

Saludos

AmiKhan

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.