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 a todos
Tengo esta pregunta en una entrevista reciente y quiero comprobar con usted el DAX correcto.
La pregunta era escribir un DAX usando SUMX - Supongamos que tenemos múltiples medidas (Ganancias, Ventas,..) y 2 dimensiones (Productos, Regiones). Si seleccionamos ganancias, debe mostrar solo los números de ganancias para productos y regiones, de manera similar, si seleccionamos Ventas, debe mostrar solo los números de ventas para productos y regiones,
Por favor, ayúdenos con el DAX.
-- Mesa de corte
SlicerTable =
TABLA DE DATOS(
"NombreDeMedida",
CUERDA
{
{"Ganancia"},
{"Ventas"}
}
)
--Medidas
Beneficio = SUMA('FactTable'[Ganancia])
Ventas = SUMA('FactTable'[Ventas])
-- Medida dinámica
MedidaSeleccionada =
VAR SelectedValue = SELECTEDVALUE('SlicerTable'[MeasureName])
DEVOLUCIÓN
INTERRUPTOR(
VERDADERO(),
SelectedValue = "Ganancia", [Ganancia],
SelectedValue = "Ventas", [Ventas]
)
-- Medida de visualización
MedidaPantalla =
SUMX(
VALUES('DimensionTable'[Producto]),
[MedidaSeleccionada]
)
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.