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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Syndicate_Admin
Administrator
Administrator

Declaración IF

Hola a todos

Tengo una declaración IF que funciona bien. Véase más abajo

GoldenBatch =
SI (
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y",
"Lote de oro",
"Señorita"
)

I want to modify condition in order to have three outputs all under one column i.e
"Lote de oro", "Miss", "In Progress".
Esto es lo que quiero hacer
GoldenBatch =
SI (
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y",
"Lote de oro"
)
||
GoldenBatch =
SI (
[thaw_onTime] = "N"
&& [proA_onTime] = "N"
&& [BDS_onTime] = "N"
&& [harvest_onTime] = "N"
&& [%RFT_RFT] = "N"
&& [titer_inFull] = "N"
&& [yield_inFull] = "N"
&& [deviation_RFT] = "N",
"Señorita",
||


SI(
[thaw_onTime] = EN BLANCO()
|| [proA_onTime] = EN BLANCO()
|| [BDS_onTime] = EN BLANCO()
|| [harvest_onTime] = EN BLANCO()
|| [%RFT_RFT] = EN BLANCO()
|| [titer_inFull] = EN BLANCO()
|| [yield_inFull] = EN BLANCO()
|| [deviation_RFT] = EN BLANCO(),
"En progreso"
)

¿Cuál es la mejor manera de escribir el DAX para que la instrucción if tenga más de 3 variables de salida?
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

De hecho, encontré una solución a esto.
1. O bien utilizar sentencias IF anidadas

2. Utilice la función de interruptor

La instrucción IF anidada dificultará su lectura, por lo que la función SWITCH funciona. Vea la solución a continuación

GoldenBatch =
INTERRUPTOR (
VERDADERO (),
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y", "Lote de oro",
[thaw_onTime] = "N"
|| [proA_onTime] = "N"
|| [BDS_onTime] = "N"
|| [harvest_onTime] = "N"
|| [%RFT_RFT] = "N"
|| [titer_inFull] = "N"
|| [yield_inFull] = "N"
|| [deviation_RFT] = "N", "Señorita",
[thaw_onTime] = ESPACIO EN BLANCO ()
|| [proA_onTime] = ESPACIO EN BLANCO ()
|| [BDS_onTime] = ESPACIO EN BLANCO ()
|| [harvest_onTime] = ESPACIO EN BLANCO ()
|| [%RFT_RFT] = ESPACIO EN BLANCO ()
|| [titer_inFull] = ESPACIO EN BLANCO ()
|| [yield_inFull] = ESPACIO EN BLANCO ()
|| [deviation_RFT] = ESPACIO EN BLANCO (), "En progreso"
)

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

De hecho, encontré una solución a esto.
1. O bien utilizar sentencias IF anidadas

2. Utilice la función de interruptor

La instrucción IF anidada dificultará su lectura, por lo que la función SWITCH funciona. Vea la solución a continuación

GoldenBatch =
INTERRUPTOR (
VERDADERO (),
[thaw_onTime] = "Y"
&& [proA_onTime] = "Y"
&& [BDS_onTime] = "Y"
&& [harvest_onTime] = "Y"
&& [%RFT_RFT] = "Y"
&& [titer_inFull] = "Y"
&& [yield_inFull] = "Y"
&& [deviation_RFT] = "Y", "Lote de oro",
[thaw_onTime] = "N"
|| [proA_onTime] = "N"
|| [BDS_onTime] = "N"
|| [harvest_onTime] = "N"
|| [%RFT_RFT] = "N"
|| [titer_inFull] = "N"
|| [yield_inFull] = "N"
|| [deviation_RFT] = "N", "Señorita",
[thaw_onTime] = ESPACIO EN BLANCO ()
|| [proA_onTime] = ESPACIO EN BLANCO ()
|| [BDS_onTime] = ESPACIO EN BLANCO ()
|| [harvest_onTime] = ESPACIO EN BLANCO ()
|| [%RFT_RFT] = ESPACIO EN BLANCO ()
|| [titer_inFull] = ESPACIO EN BLANCO ()
|| [yield_inFull] = ESPACIO EN BLANCO ()
|| [deviation_RFT] = ESPACIO EN BLANCO (), "En progreso"
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors