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
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
v-yiruan-msft
Community Support
Community Support

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

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

View solution in original post

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

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

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

@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
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.