The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hola
Necesito calcular un promedio ponderado para el precio al consumidor.
Actualmente, CP YTD se calcula como Average(DB(consumer price). Sin embargo, si utilizo esta fórmula recibo una media aritmética.
Necesito sopesar el precio al consumidor para NES YTD (Ventas).
la fórmula debe ser algo así como: (CP YTD*NES YTD)/sum(NES YTD). sin embargo, necesito hacer eso para cada nivel.
por ejemplo:
para liv6 [(NES Ytd 541... * CP YTD 541... ) / suma (NES YTD 541... + NES YTD 541... y así sucesivamente) ]
el denominador debe ajustarse dinámicamente en función del nivel que se analice.
¿Cómo puedo hacerlo en DAX?
Gracias por la ayuda
Solved! Go to Solution.
Intente utilizar la función sumx.
WA =
VAR total_ =
CALCULATE(
[NES YTD],
ALL(xxxxx)
)
VAR _Table =
ADDCOLUMNS(
SUMMARIZE(
Sales,
xxx[Row1],xxx[Row2]
),
"nes", [NES YTD],
"cp", [CP YTD]
)
RETURN
SUMX(
_Table ,
[cp] * [nes]/total_
)
Gracias por su respuesta!
Sólo tengo algunas preguntas más?
Realmente aprecio su ayuda!
Hace referencia al nombre de columna de las etiquetas de fila. Si el problema persiste, proporcione algunos datos de ejemplo, preferiblemente un pbix después de eliminar los datos confidenciales.
Intente utilizar la función sumx.
WA =
VAR total_ =
CALCULATE(
[NES YTD],
ALL(xxxxx)
)
VAR _Table =
ADDCOLUMNS(
SUMMARIZE(
Sales,
xxx[Row1],xxx[Row2]
),
"nes", [NES YTD],
"cp", [CP YTD]
)
RETURN
SUMX(
_Table ,
[cp] * [nes]/total_
)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.