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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Promedio ponderado con condición

¡Hola expertos en Power BI!

Tengo un conjunto de datos con los últimos 12 meses en los que he calculado el promedio ponderado total en todos los meses que estoy viendo. El cálculo es bastante simple y está funcionando bien.

TotalWeightedAvg = DIVIDE(
    SUMX('Monthly Sales (Product Level)','Monthly Sales (Product Level)'[AdjustedREUnits] * 'Monthly Sales (Product Level)'[YearlyRatio]),
    SUMX('Monthly Sales (Product Level)','Monthly Sales (Product Level)'[AdjustedREUnits]),0)

Pero también necesito uno en el que obtenga el promedio ponderado por mes. ¿Cómo agrego una condición en la que miro una columna (llamada MonthRank) donde he clasificado los meses individuales del 1 al 12, para obtener el promedio ponderado por mes? Habrá varias filas para cada MonthRank.

¡Gracias de antemano!

Pasa un buen fin de semana.

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@nbrandborg , Esto se ve bien para Weighted Avg. Para un promedio simple que necesita

TotalWeightedAvg = Averagex(Values('Date'[Month Rank), calculate( DIVIDE(
SUMX('Ventas mensuales (nivel de producto)','Ventas mensuales (nivel de producto)'[Unidades ajustadas] * 'Ventas mensuales (nivel de producto)'[Relación anual]),
SUMX('Ventas mensuales (nivel de producto)','Ventas mensuales (nivel de producto)'[Unidades ajustadas]),0)) )

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors