cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors