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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Obtener el promedio de la segunda columna agrupada en función de los valores de la primera columna

Me gustaría obtener el promedio de recuentos de valores dentro de una columna dividido por grupo definido por una segunda columna

DeporteMétodo
Baloncesto Pelota
BaloncestoPelota
BéisbolPelota
Béisbol Pelota
FútbolPelota
MMA

Guantes

Boxeo Guantes
BoxeoGuantes
Boxeo Guantes
LuchaGrapling
JudoGrapling

Basándome en el largo conjunto de datos que es la fuente, me gustaría crear un resultado o medir dónde están los valores que obtengo

MétodoPromedio
Grapling1
Guantes2
Pelota1.667

La pelota es 1.667 porque el baloncesto tiene 2 filas, el béisbol tiene 2 filas y el fútbol tiene 1 fila. (2+2+1)/3=1,667

¿Es posible una medida o tabla como esta?

2 ACCEPTED SOLUTIONS
Syndicate_Admin
Administrator
Administrator

Hola

Average =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Sport],
        'Table'[Method],
        "Count", COUNTROWS ( 'Table' )
    )
RETURN
    AVERAGEX ( MyTable, [Count] )

Saludos

View solution in original post

Syndicate_Admin
Administrator
Administrator

@user35131

Cree una medida de la siguiente manera y agréguelo a un objeto visual de tabla con Método

Average Sport = 
DIVIDE(
    COUNTA(Table5[Sport]),
    DISTINCTCOUNT(Table5[Sport])
)

Fowmy_0-1630523259608.png


View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

@user35131

Cree una medida de la siguiente manera y agréguelo a un objeto visual de tabla con Método

Average Sport = 
DIVIDE(
    COUNTA(Table5[Sport]),
    DISTINCTCOUNT(Table5[Sport])
)

Fowmy_0-1630523259608.png


Syndicate_Admin
Administrator
Administrator

Hola

Average =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Sport],
        'Table'[Method],
        "Count", COUNTROWS ( 'Table' )
    )
RETURN
    AVERAGEX ( MyTable, [Count] )

Saludos

Gracias. Me preguntaba y debería haberlo notado. ¿Hay alguna manera de congelar o bloquear el resultado del promedio? Similar a la configuración de esta pregunta. https://community.powerbi.com/t5/Desktop/Filter-by-slicer-for-one-column-but-freeze-or-lock-the-max-...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.