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

Agrupación

Hola
Así que necesito ayuda con el cálculo.

La tabla tiene muchas columnas. Uno de ellos es el número de pedido (un número se repite pero tiene datos diferentes). Solo ejemplo:

Orden NRClientePrecio
214a30
214b10
215c20
216d10
216e40

Precio medio = 22
Precio medio del número de pedido = (30+10)+20+(10+40) / 3 =36,6


Precio es una columna calculada.
Necesito saber cuál es el precio medio del NÚMERO DE PEDIDO
Gracias por la ayuda
Aleks

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@ALEKSGOD ,

Estos son los pasos que puede seguir:

Medir:

Measure =
var _sum=SUMX(ALL('Table'),[Price])
var _count=CALCULATE(DISTINCTCOUNT('Table'[Order NR]),ALL('Table'))
return
DIVIDE(_sum,_count)

Columna calculada:

Column =
var _sum=SUMX(ALL('Table'),[Price])
var _count=DISTINCTCOUNT('Table'[Order NR])
return
DIVIDE(_sum,_count)

Resultado:

vyangliumsft_0-1670561033135.png

Saludos

Liu Yang

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Syndicate_Admin
Administrator
Administrator

Probar

Avg Price per order number =
AVERAGEX (
    ADDCOLUMNS (
        VALUES ( 'Table'[Order number] ),
        "@val", CALCULATE ( SUM ( 'Table'[Price] ) )
    ),
    [@val]
)

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.