Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Me gustaría crear medidas para calcular los recuentos de deportes dentro de AllSports de la Tabla 1, así como la calificación media y el sentimiento para cada uno de los Deportes en la Tabla 2. Por ejemplo para el fútbol - el conteo es 2, la calificación promedio es 4, el sentimiento promedio es 0.2.
Quería calcular estas medidas para poder crear un gráfico de burbujas que muestre cada deporte, dimensionado por el conteo, y con la calificación avg y el sentimiento en mis ejes x e y.
No quiero crear una medida para contar para cada deporte, porque entonces puede haber un nóteo de medidas.
@ImkeF No conseguimos encontrar tu ubicación exacta.
Tabla 1:
Clasificación | Sentimiento | AllSports |
4 | 0.6 | Hockey, Frisbee, Golf |
5 | 0.3 | Golf, Tenis |
3 | 0.2 | Rugby, Hockey |
5 | 0.5 | Golf |
3 | 0.3 | Fútbol |
5 | 0.1 | Fútbol, Golf |
Cuadro 2:
Deportes |
Hockey |
Frisbee |
Golf |
Tenis |
Rugby |
Fútbol |
Solved! Go to Solution.
Hola @jvirgi ,
Puede crear 2 medidas para calcular el promedio de calificación y sentimiento como se muestra a continuación:
Avg rating =
SUMX (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
),
'Table 1'[Rating]
)
/ COUNTROWS (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
)
)
Avg sentiment =
SUMX (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
),
'Table 1'[Sentiment]
)
/ COUNTROWS (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
)
)
Saludos
Rena
Hola @jvirgi ,
Puede crear 2 medidas para calcular el promedio de calificación y sentimiento como se muestra a continuación:
Avg rating =
SUMX (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
),
'Table 1'[Rating]
)
/ COUNTROWS (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
)
)
Avg sentiment =
SUMX (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
),
'Table 1'[Sentiment]
)
/ COUNTROWS (
FILTER (
'Table 1',
SEARCH ( MAX ( 'Table 2'[Sports] ), 'Table 1'[AllSports], 1, 0 ) > 0
)
)
Saludos
Rena
@yingyinr ¡Gracias! Esto es exactamente lo que estaba buscando.
Sin embargo, noto cuando también intento hacer un gráfico de rosquillas de la ruptura del número de deportes, no obtengo nada cuando uso Table2[Deportes] como mi leyenda y los countrows miden como mis valores.
No estoy seguro de si esto es por qué, pero cuando acabo de crear una tabla de matriz para Sport, Count of sports, Avg rating, Average sentiment, the table totals muestra el valor de solo la fila final de la tabla en lugar de un promedio en todas las filas.
@yingyinr En realidad fue mi error, la tabla de rosquillas funcionó bien... Lo tenía configurado mal.
Pero, ¿sabe por qué los totales de tabla de matriz muestran solo el valor de las filas finales?
Hola @jvirgi ,
He creado este archivo como ejemplo: Descargar PBIX
Usé Power Query para dividir el deporte en nuevas filas.
Ricardo
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.