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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jvirgi
Helper III
Helper III

Cálculo de medidas mediante la búsqueda de texto en otra tabla

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ónSentimientoAllSports
40.6Hockey, Frisbee, Golf
50.3Golf, Tenis
30.2Rugby, Hockey
50.5Golf
30.3Fútbol
50.1Fútbol, Golf

Cuadro 2:

Deportes
Hockey
Frisbee
Golf
Tenis
Rugby
Fútbol
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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
        )
    )

Calculating Measures by Searching text in another table.JPG

Saludos

Rena

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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
        )
    )

Calculating Measures by Searching text in another table.JPG

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?

camargos88
Community Champion
Community Champion

Hola @jvirgi ,

He creado este archivo como ejemplo: Descargar PBIX

Usé Power Query para dividir el deporte en nuevas filas.

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors