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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Syndicate_Admin
Administrator
Administrator

SWITCH Satement no devuelve valores

Hola

Tengo la siguiente tabla en mi modelo:

GSntna_0-1685559798805.png

Creé una medida para devolver una cadena determinada dependiendo del valor de la columna Cuenta GL. Aquí está el código (modificado, más fácil de replicar).

Actuals USD = 
SWITCH(FIRSTNONBLANK(M_Consol_Pnl[GL Account], M_Consol_Pnl[GL Account]),
"HW Revenue", [Total System Revenue],
"HW Margin", [Total System CM],
"HW Margin %", [Total System CM %],
"Supp Revenue", [Total System Revenue],
"Supp Margin", [Total System Revenue],
"Supp Margin %", [Total System Revenue],
"Serv & Supp Rev", [Total System Revenue],
"Serv & Supp Margin", [Total System Revenue],
"Serv & Supp Margin %", [Total System Revenue],
"SW & Soltions Rev", [Total System Revenue],
"SW & Solutions Margin", [Total System Revenue],
"SW & Solutions Margin %", [Total System Revenue],
"Total System Rev", [Total System Revenue],
"Total System Margin", [Total System Revenue],
"Total System Margin %", [Total System Revenue],
BLANK()
)

Las medidas que se devuelven para cada uno de los casos de cambio se realizan de la siguiente manera:

Total System Revenue = CALCULATE(SUM(Source_PnL[Amount]),Source_PnL[GL_Account]="Total Revenue")

Esto es básicamente una función sumif, la única parte que cambiaría sería la parte Source_PnL[GL_Account]="Ingresos totales ".

El problema es que cuando creo el objeto visual, parece que algunos valores no se devuelven al azar; Digo aleatoriamente porque la medida POR USD se creó exactamente de la misma manera, pero devuelve información de otra tabla y solo muestra filas aleatorias.

GSntna_2-1685560966697.png

Creé todo esto hace unos dos meses y lo extraño es que todo funcionó perfectamente en ese entonces. ¿Sabe si hubo una actualización de Power BI que podría haber afectado a la fórmula? ¿Hay algo que deba cambiar?

0 REPLIES 0

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.