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

Desea mostrar el promedio de totales

Hola

Tengo datos de la siguiente manera:

CATEGORÍASUBCATEGORÍAVALOR
MUEBLESILLAS1000
MUEBLEBIBLIOTECA1200
MUEBLEMESA2000
ELECTRÓNICAMÓVIL25000
ELECTRÓNICAAire acondicionado22000
ELECTRÓNICALAVADORA25000
MENAJE DE COCINATAZÓN600
MENAJE DE COCINABATIDORA10000
MENAJE DE COCINACOCINA ELÉCTRICA5000

Necesito mostrar el promedio de totales en la tabla de matrices en lugar de los totales (es decir, los totales como 72000,4200,15600 deben reemplazarse por 30,600, que es un promedio de 72000,4200,15600)

AshDil_0-1637551833645.png

Por favor, ayúdame a hacerlo.

Gracias

AshDil.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Hola

Por favor, compruebe la imagen de abajo y el archivo pbix adjunto.

Picture1.png

Medida de valor: =
DONDE value_sum =
SUMA ( Datos[VALOR] )
DONDE value_sum_bycategory =
ADDCOLUMNS (
RESUMIR ( TODOS ( datos ), Datos[CATEGORÍA] ),
"@sum", CALCULAR ( SUMA ( Datos [VALOR] ) )
)
DONDE value_avg_bycategory =
AVERAGEX ( value_sum_bycategory, [@sum] )
DEVOLUCIÓN
INTERRUPTOR (
VERDADERO (),
ISINSCOPE ( Datos[CATEGORÍA] ), value_avg_bycategory,
value_sum
)

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Para mostrar el promedio de totales en DAX, puede usar la función AVERAGEX. La función AVERAGEX calcula el promedio de una columna basándose en una expresión dada.

Por ejemplo, supongamos que tiene una tabla llamada "Datos" con las columnas "Categoría" y "Total". Para calcular el promedio total de cada categoría, puede usar la siguiente fórmula:

=AVERAGEX(GROUPBY(Datos, Datos[Categoría]), Datos[Total])

Syndicate_Admin
Administrator
Administrator

Hola

Por favor, compruebe la imagen de abajo y el archivo pbix adjunto.

Picture1.png

Medida de valor: =
DONDE value_sum =
SUMA ( Datos[VALOR] )
DONDE value_sum_bycategory =
ADDCOLUMNS (
RESUMIR ( TODOS ( datos ), Datos[CATEGORÍA] ),
"@sum", CALCULAR ( SUMA ( Datos [VALOR] ) )
)
DONDE value_avg_bycategory =
AVERAGEX ( value_sum_bycategory, [@sum] )
DEVOLUCIÓN
INTERRUPTOR (
VERDADERO (),
ISINSCOPE ( Datos[CATEGORÍA] ), value_avg_bycategory,
value_sum
)

@Jihwan_Kim ,

Gracias por compartir. Trabajaré en ello.

Gracias

AshDil.

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.