Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hola
En mi ejemplo, mi medida no se ejecuta
quiero mostrar: si TotalProduct es null el TotalBudget else TotalProduct en la fila está bien, pero en el gran total es KO
Muchas gracias
Esto está relacionado con el contexto cuando agrega más valores a su tabla luego el cambio de contexto en este caso el producto agrega un nivel de granularidad que cambia los valores, porque en el mes de octubre cuando tiene valores no obtiene el 200 para 68100.
Pruebe la siguiente medida:
IfNotSaleThenBudget2 =
var SalesTable = SUMMARIZE (
sales,
'product'[product],
'Calendar'[Year],
'Calendar'[Month Number],
"TotalValue", [IfNotSalesThenBudget], "IDColumn",
'product'[product]& 'Calendar'[Year]&
'Calendar'[Month Number]
)
var FilterSalesValues = SELECTCOLUMNS(SalesTable, "FilterID", [IDColumn])
return
SUMX( union(
filter (SUMMARIZE (
budget,
'product'[product],
'Calendar'[Year],
'Calendar'[Month Number],
"TotalValue", [IfNotSalesThenBudget], "IDColumn",
'product'[product]& 'Calendar'[Year]&
'Calendar'[Month Number]
), NOT([IDColumn] in FilterSalesValues))
,SalesTable), [TotalValue])
Resultado a continuación y en archivo adjunto:
Hola @MFelix
Gracias por su respuesta
pero tu medida no funciona con mi modelo, creo un PBIX de noticias para simular el error
la matriz calcula 317K pero el número real es 318 K
Si tienes otra idea
Muchas gracias
Esto está relacionado con la transición de contexto cuando se está haciendo la comparación ya que la línea total el valor para el 42.802 por lo que su suma hasta el mismo valor tiene en la otra columna se debe hacer la siguiente medida:
IfNotSalesThenBudget = SUMX(VALUES('Calendar'[Month]),if([TotalProduct]=0,[TotalBudget],[TotalProduct]))
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.